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

Accessibility issue - Focus trap in modal is not working when the focus element is removed from the DOM #2026

Closed
eitanavgil opened this issue Mar 16, 2023 · 1 comment
Labels
Resolution: Duplicate This issue is a duplicate

Comments

@eitanavgil
Copy link

eitanavgil commented Mar 16, 2023

Bug report

Modals should trap focus and keep the focus inside. If the focus is on something that is removed from the DOM the focus does not stay inside the modal, but is moving to the body and the modal is kept open while navigation is outside of it.

Current Behavior

See video here

Expected behavior

Modals should keep focus in it no matter what.

Reproducible example

https://wk3r6u-5173.csb.app/

Suggested solution

Whatever happens - keep the focus on the modal

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-dialog
React n/a 17.0.2
Browser chrome
Assistive tech keyboard tabbing
Node n/a 14
npm/yarn yarn
Operating System osx
@benoitgrelard
Copy link
Collaborator

Duplicate of #1498

@benoitgrelard benoitgrelard marked this as a duplicate of #1498 Mar 16, 2023
@benoitgrelard benoitgrelard closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2023
@benoitgrelard benoitgrelard added the Resolution: Duplicate This issue is a duplicate label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate This issue is a duplicate
Projects
None yet
Development

No branches or pull requests

2 participants