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

Clicking on dropdown doesn't make it focused #185

Open
Vanuan opened this issue Mar 8, 2020 · 4 comments
Open

Clicking on dropdown doesn't make it focused #185

Vanuan opened this issue Mar 8, 2020 · 4 comments

Comments

@Vanuan
Copy link

Vanuan commented Mar 8, 2020

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.

@Vanuan
Copy link
Author

Vanuan commented Mar 8, 2020

Found a workaround:

const dropdown = useRef(null);
<Dropdown ref={dropdown} onFocus={() => dropdown.current.focus()} />

But why.

@sfehlandt
Copy link

Hi @Vanuan I couldn't make your workaround work. Does it make the component focusable via keyboard as well? or only through click?

@Vanuan
Copy link
Author

Vanuan commented Jun 15, 2020

It seems the workaround works only for the older version of react-dropdown

@ebwinters
Copy link

+1, this how has this not been fixed lol. Stopped using the package due to this

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

No branches or pull requests

3 participants