Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip non selectable items #456

Draft
wants to merge 2 commits into
base: feature/v5
Choose a base branch
from

Conversation

b3ngg
Copy link

@b3ngg b3ngg commented Aug 11, 2022

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.

@rob-balfre
Copy link
Owner

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

@b3ngg
Copy link
Author

b3ngg commented Aug 17, 2022

@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 b3ngg marked this pull request as draft August 17, 2022 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants