Clicking on dropdown doesn't make it focused
Vanuan opened this issue · comments
John Yani commented
Why? Why did you add stopPropagation()
and preventDefault()
here?
https://github.com/fraserxu/react-dropdown/blob/747af52959bc4a4ee8a7d8c9779b498a07123bee/index.js#L52-L53
This prevents the div with tabindex to be focused.
John Yani commented
Found a workaround:
const dropdown = useRef(null);
<Dropdown ref={dropdown} onFocus={() => dropdown.current.focus()} />
But why.
Sebastian Fehlandt commented
Hi @Vanuan I couldn't make your workaround work. Does it make the component focusable via keyboard as well? or only through click?
John Yani commented
It seems the workaround works only for the older version of react-dropdown
Ethan Winters commented
+1, this how has this not been fixed lol. Stopped using the package due to this