Closed meshe03 closed 3 years ago
Hi. The reason for that is that the country selector uses a native <select/>
. The native <select/>
doesn't always expand on Enter
: sometimes it only expands on spacebar. I'm on Windows and this is how it works in this OS in Firefox (while in Chrome it does expand both on Enter
and spacebar). I assume you're on a Mac/Safari.
We could add a hack: something like <select onKeyDown={ if Enter then select.click() }/>
but why would we if that is not how a standard select works, and a standard select can't misbehave.
To verify the standardized <select/>
behavior, a <select/>
demo could be used:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select
Actually, I should test it first.
Actually, it does expand on Enter on the demo page for me. I'm on Windows. Is this a Mac-specific issue?
I'm on Chrome, btw.
Tested in Firefox, and in Firefox it doesn't expand on Enter. So, this behavior is standardized and is browser-specific. So, it's not an issue.
Oh I see! I tried with space bar in my Mac using chrome and it works perfectly. And you're right, this is a standard behavior on select so it doesn't make much sense to force the list to be displayed by doing enter.
Thank you so much for your reply 😄
Hi! In my current project we are using this library. We want to make our web more accessible. I checked the demo and the select is focused as expected but when enter key is pressed the country selector isn't triggered. This implies that there is no way to modify the country for people who only navigate with the keyboard.