adobe / adobe/spectrum-web-components

[Bug]: Trigger directive with hover interaction does not close overlay reliably

Open
#5,508 1 comment 0 reactions 0 assignees View on GitHub
bug Component:Overlay SEV 3
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

![Image](https://github.com/user-attachments/assets/6c513478-2101-481e-b14b-5b90a1b9a72f)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.