[dialog] Escape closes multiple sibling dialogs when 3+ are open simultaneously
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 543
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 101
Description
# Bug report
## Current behavior
When 3+ non-nested sibling modal dialogs are open simultaneously, pressing Escape closes multiple dialogs instead of only the topmost one. With 2 sibling dialogs, Escape correctly closes only the topmost. With 3+, the topmost closes first, then the remaining dialogs close together on the same keypress.
## Expected behavior
Each Escape press should close only the topmost dialog, regardless of how many sibling dialogs are open. Three dialogs should require three Escape presses to close all of them.
## Reproducible example
https://codepen.io/macieklamberski/full/azmRjdm
## Base UI version
v1.3.0
## Which browser are you using?
Chrome (also reproducible in Safari and Firefox)
## Which OS are you using?
Mac OS
## Which assistive tech are you using (if applicable)?
N/A
## Additional context
N/A
Contributor guide
Assessment
This issue has not been assessed yet.