-
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: select an item only from the filtered list of options (#7789)
Fixes a bug where the `handleSelection` function would select the wrong item under certain conditions. Because we always sent the unfiltered list of options to the function, but took the index of the filtered items, the index would be off when you have filtered the list and items before the selected items were hidden. This addresses that and also ports in some improvements I made when setting up the config buttons for the new dialogs: 1. You can now use the space bar to select items that you have focused (this is consistent with regular form interactions for checkboxes) 2. When you have added text to the search field, pressing Enter will select the top-most item (this is consistent with how these fields work in linear, for instance) as long as your focus is still in the search field. If you have moved it to the list, enter will still select an item on that list as expected. Potential other addition: if you press "Enter" with an empty search field, we could close the box but keep your selection the same. Again, this is how Linear does it, but I don't personally know what I'd expect to happen there, so I'm happy to leave it as is.
- Loading branch information
1 parent
22d97ff
commit 4fac38c
Showing
1 changed file
with
59 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters