adobe / adobe/spectrum-web-components
[Bug]: Trigger directive with hover interaction does not close overlay reliably
- 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, trigger directive
### Expected behavior
After triggering an overlay on hover on a button with the trigger directive, when the pointer leaves the button, the overlay should close.
### Actual behavior
When the pointer leaves the button, the overlay remains open and the button is focused. Even when clicking outside of the button and overlay, the overlay remains open.
### Screenshots

https://github.com/user-attachments/assets/0bc36ace-4147-47ae-8668-ffa27fdfc322
### 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-y8ropxrn?file=package.json,src%2Fmy-element.ts
2. Hover over the button
3. Stop hovering over the button
### Sample code or abstract reproduction which illustrates the problem
_No response_
### Severity
SEV 3
### 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 and inspect the sp-overlay trigger directive behavior for the hover interaction. Reproduce the overlay remaining open after the pointer leaves the button and after clicking outside; done means the overlay reliably closes in both cases.
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