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

Fix keyboard navigation #14

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jonasclement
Copy link
Contributor

@jonasclement jonasclement commented Nov 24, 2021

Hello.

I noticed that this library has a few flaws regarding keyboard accessibility, and I've done my best to fix them here :)

Fixed issues:

  • Type-ahead
    • Would always select the first matching option, rather than the next matching option, like a native select would.
    • Had problems when you would use the spacebar for a multi-word option
  • General keyboard navigation
    • Arrow keys and type-ahead didn't work without opening the select first - this doesn't match with native select behavior either

@jonasclement
Copy link
Contributor Author

jonasclement commented Dec 8, 2021

Hello,

I added a few more commits with some additional fixes:

  • The drop-down now opens when you press the spacebar while it's focused.
  • Fixed enter key flashing the dropdown - now it toggles properly instead.

@andrewvasilchuk
Copy link
Owner

@jonasclement thanks for your PR. I'm investigating your changes.

@andrewvasilchuk
Copy link
Owner

@jonasclement This one still does not work for me.

Would always select the first matching option, rather than the next matching option, like a native select would.

Don't you mind if I also contribute to your PR?

@jonasclement
Copy link
Contributor Author

Hmm, no, I see that that doesn't work - I'm sure I fixed it at some point!

You're welcome contribute as you like. I'm going to look into the issue now, and hopefully push a working fix :)

@jonasclement
Copy link
Contributor Author

Check out a4d6bb9 - should be working as expected now :)

@jonasclement
Copy link
Contributor Author

Hey mate - any progress on this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants