Fix#8839: Cannot select item from command selector #8842
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @Eugeny, I hope all is well with you.
Fix #8839 : This PR aims to fix the issue #8839. Commit d354520 avoid the
selectedIndex
value to be NaN cause of modulo(this.selectedIndex + this.filteredOptions.length) % this.filteredOptions.length
whenfilteredOptions
is empty. OnceselectedIndex
in NaN, theOnFilterChange
method is no longer able to do operation withselectedIndex
which cause the selector to do not have any element selected any more even if the filter is empty or matches elements.ad3b03c: I also added a small feature on PageUp & PageDown event to limit the number of elements being skipped when the key is press.
tabby/tabby-core/src/components/selectorModal.component.ts
Lines 35 to 40 in 634d88d
On 1.0.197:
Open selector. Select the second element before the end and press PageDown.
The eighth from the start will be the one selected now.
With this PR:
Open selector. Select the second element before the end and press PageDown.
The last element of the list will be the one selected now.
Press PageDown again.
It will select the first element from the top of the list.
Same inverse behavior on PageUp.
As always, feel free to ask me if any change are needed !