svelte-select icon indicating copy to clipboard operation
svelte-select copied to clipboard

Skip non selectable items

Open b3ngg opened this issue 2 years ago • 2 comments

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 avatar Aug 11 '22 11:08 b3ngg

@b3ngg thanks for the PR. Got 15 failing tests with these changes though.

rob-balfre avatar Aug 17 '22 03:08 rob-balfre

@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.

b3ngg avatar Aug 17 '22 06:08 b3ngg