-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Dialogs should trap focus #4384
Comments
Ref #61. |
Big 👍 to this. I played around with https://github.com/davidtheclark/focus-trap-react last weekend and it nearly works as a drop-in replacement. a few caveats:
|
@matthewoates I have a dialog ready which solves this issue (and also improves the dialog component structure and API). It is using I'll be submitting my dialog refactor PR for consideration after I finish working on some style related things -- I thought I would mention in case you wanted to focus your efforts on another area. @mbrookes we need to setup that roadmap! Also, this is a dupe of #156 |
How about autocomplete & focus? |
Was there a regression for this issue? Dialogs do not seem to trap focus for me. |
They don't for me either. |
They seem to have just closed the issue without fixing it or it might have regressed. It does not work. I opened a new issue #10458. |
Problem description
When a dialog is drawn with multiple elements, keyboard navigation allows the user to switch focus. But when the last element is focused and tab is hit, focus should switch back to the first element.
Steps to reproduce
Create a dialog with a few fields. Use tab to switch focus till the last element. Hit tab once again3
Versions
The text was updated successfully, but these errors were encountered: