-
Notifications
You must be signed in to change notification settings - Fork 561
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
Dialog's focus lock steals focus across frame boundaries #536
Comments
Interestingly this isn't an issue in Firefox 🤔 but this seems like a good use for @theKashey Have you any thoughts? I wasn't around back when Ryan implemented |
I've experienced exactly this codesandbox issue during focus-lock development - while it is active the rest of application is basically 💀dead💀. And it is a bug. There are a few moments:
The sequence is the following:
If And here is the problem - Should be easy to fix the problem, as well as create a test for it. Thanks for calling me 👍 |
Even better, and thanks for the detailed explanation @theKashey! |
I am adding new
I am not sure which behaviour is actually correct - |
Said option was added in |
Nice one @chancestrickland (and @theKashey) that fixes our problem, thank you very much 🎉 🙌 |
Added the |
@chaance, what is the difference between setting |
|
🐛 Bug report
Current Behavior
Check the CodeSandbox example linked below. When opening the Dialog by clicking
Show Dialog
the button in it gets focussed (so far so good). Now use the mouse to return focus to the CodeSandbox and try to type something. As soon as you begin, the focus is returned to the button in the dialog.The problem in our setup is a bit more complex as we're opening a Google Driver Picker from a dialog but the underlying problem seems to be the same: The focus lock on the dialog is too aggressive.
Expected Behavior
The focus lock does not interfere with frame boundaries (ie. doesn't steal focus from iframes or the like).
Reproducible example
CodeSandbox
Suggested solution(s)
At first I wanted to propose to make this configurable through a prop like
disableFocusLock
. However, given the extreme example of the CodeSandbox being rendered unusable maybe there is a more holistic solution to this. Maybe this is even an issue in react-focus-lock?Happy to help implement something after a pointer in the right direction 🙌
Your environment
Edit: This might be related to #83
The text was updated successfully, but these errors were encountered: