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

Method to not lock mouseEvent focusing #176

Closed
tounsoo opened this issue Oct 12, 2021 · 5 comments
Closed

Method to not lock mouseEvent focusing #176

tounsoo opened this issue Oct 12, 2021 · 5 comments

Comments

@tounsoo
Copy link

tounsoo commented Oct 12, 2021

We have a use case where we want to focusLock on tabs but not on mouse click.

Here is an example where we try to make that happen but the problem we are facing is that it will require 2 clicks to focus on the outside input. Any idea on how to make this happen without requiring 2 clicks?

https://codesandbox.io/s/hardcore-gagarin-mjh4v?file=/index.js

@theKashey
Copy link
Owner

Not something supported out of the box.

@tounsoo
Copy link
Author

tounsoo commented Oct 13, 2021

@theKashey Thank you! I used the second option and created onClickOutside useEffect to handle it :D

@theKashey
Copy link
Owner

🙄 Is it working for you? My advice was not supported by any real experiment.

@tounsoo
Copy link
Author

tounsoo commented Oct 13, 2021

You can checkout the codesandbox, I updated it and made it into a FC so I can reuse it

@theKashey
Copy link
Owner

Amazing! Thank you @alexreardon for running into this issue, and helping @tounsoo to resolve theirs.

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

2 participants