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

[Dialog] Focus gets lost under certain conditions with nested dialogs #1466

Open
atomiks opened this issue Feb 20, 2025 · 0 comments
Open

[Dialog] Focus gets lost under certain conditions with nested dialogs #1466

atomiks opened this issue Feb 20, 2025 · 0 comments
Labels
bug 🐛 Something doesn't work component: alert dialog This is the name of the generic UI component, not the React module! component: dialog This is the name of the generic UI component, not the React module!

Comments

@atomiks
Copy link
Contributor

atomiks commented Feb 20, 2025

Bug report

Current behavior

  1. Nested dialogs: open nested dialog and press outside with a pointer. Focus is ignored and not returned to its trigger, so subsequent tabs aren't trapped unless pressing inside the dialog with the pointer
  2. Close confirmation: type a char in the textarea and press Cancel. Press the esc key 3 times quickly. Focus gets returned to the root trigger, not the Cancel trigger

Expected behavior

  1. Focus should return to the trigger with preventScroll: true if it's available for outside presses instead of being ignored
  2. Focus shouldn't return to the root and should stay trapped

Reproducible example

Link to a CodeSandbox, StackBlitz, or other IDE.

Base UI version

1.0.0-alpha.6

Which browser are you using?

Chrome/Safari/Firefox/Safari iOS etc.

Which OS are you using?

Mac OS/Windows/Other etc.

Which assistive tech are you using (if applicable)?

Voiceover/JAWS etc.

Additional context

Provide any additional context that might help us identify the problem and find a solution.

@atomiks atomiks added bug 🐛 Something doesn't work component: alert dialog This is the name of the generic UI component, not the React module! component: dialog This is the name of the generic UI component, not the React module! labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: alert dialog This is the name of the generic UI component, not the React module! component: dialog This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

1 participant