adobe / adobe/spectrum-web-components
[Bug]: Modal overlays do not always close on Esc
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 262
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 68
Description
### Code of conduct
- [x] I agree to follow this project's code of conduct.
### Impacted component(s)
sp-overlay
### Library version
1.7.0
### Expected behavior
Pressing Esc when a modal overlay is opened should close it.
### Actual behavior
Pressing Esc does not always close the topmost modal overlay.
### Screenshots
_No response_
### What browsers are you seeing the problem in?
_No response_
### How can we reproduce this issue?
1. Go to https://stackblitz.com/edit/vitejs-vite-6qhlkpyu?file=src%2Fmy-element.ts
2. Click on the button
3. Hit Esc
### Sample code or abstract reproduction which illustrates the problem
_No response_
### Severity
SEV 2
### Logs taken while reproducing problem
_No response_
### Would you like to track this issue in Jira?
- [x] Yes, please tell me the ticket number!
Contributor guide
Research direction
Start with the linked StackBlitz reproduction at src/my-element.ts and inspect the sp-overlay component involved in the Esc interaction. Reproduce the failure with a modal overlay and confirm that pressing Esc consistently closes the topmost overlay; use the reproduction to verify the behavior after the change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100