svelte-select
svelte-select copied to clipboard
Skip non selectable items
closes #404
This prevents the selection of non selectable item when searching a select field and using the arrow keys. This improves the user experience when searching for example in a group select without isGroupHeaderSelectable
enabled as the first item is directly selected and no additional arrow key usage is required.
For this reason I added two new functions for manipulating the hoverItemIndex
that incorporate a mechanism for skipping non selectable items. One for setting to a specific index and one for incrementing or decrementing the index.
I used the the new methods in a few places, however, due to my lack of overview of the codebase, I am not sure if it fits in all places.
PS: Sorry I opened #455 by accident.
@b3ngg thanks for the PR. Got 15 failing tests with these changes though.
@rob-balfre Whoops, sorry. Unfortunately the tests are not working for me locally. I try to get them working when I've got some time.