Open vvo opened 4 years ago
Thanks for reporting, I'll take a look!
Side note, I asked tailwindui peeps and they said tabIndex=0 was on purpose on the main div of their layouts, so that users can skip to content and navigate it easily. Now should react-select-search have tabIndex=0 too? I am not so sure :D
The tabindex=0 on the input field is not necessary, but it also doesn't produce any side effects. It comes from the valueProps
and is needed if you use a div instead of an input as the value component for example.
But we might need to reconsider the focus handling here. Need to experiment with this.
Hi there, if you use SelectSearch inside a div with tabIndex={0} then the menu will close as soon as you touch the scrollbar, see:
https://codesandbox.io/s/admiring-kepler-29e6x?file=/src/App.js
Why use tabIndex={0}? It seems to offer extended keyboard navigation, see https://webaim.org/techniques/keyboard/tabindex#zero-negative-one. In my case, the https://tailwindui.com/ application layouts recommend to use it.