diff options
-rw-r--r-- | ui.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui.js b/ui.js index 73442d0..241bf99 100644 --- a/ui.js +++ b/ui.js @@ -378,7 +378,13 @@ class GrouplikeListingElement extends ListScrollForm { if (parent) { const oldGrouplike = this.grouplike this.loadGrouplike(parent) - this.curIndex = this.inputs.findIndex(inp => inp.item === oldGrouplike) || this.firstItemIndex + + const index = this.inputs.findIndex(inp => inp.item === oldGrouplike) + if (typeof index === 'number') { + this.curIndex = index + } else { + this.curIndex = this.firstItemIndex + } this.updateSelectedElement() this.scrollSelectedElementIntoView() } |