« get me outta code hell

Fix wrong element being selected on groups w/o parents - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-07-04 22:54:27 -0300
committerFlorrie <towerofnix@gmail.com>2018-07-04 22:54:27 -0300
commit5cbc7ac9030c16858e6426ae980ec8728372054e (patch)
treeb7130a04ce45f574b115c2056af758218d5c97c3 /ui.js
parentbef63acfad7a793f9bd72cb3985c57b60bf58b77 (diff)
Fix wrong element being selected on groups w/o parents
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 4ad09e9..13774cd 100644
--- a/ui.js
+++ b/ui.js
@@ -666,7 +666,7 @@ class GrouplikeListingForm extends ListScrollForm {
   }
 
   get firstItemIndex() {
-    return Math.min(this.inputs.length, 1)
+    return Math.max(0, this.inputs.findIndex(el => el instanceof GrouplikeItemElement))
   }
 
   selectAndShow(item) {