adobe / adobe/spectrum-web-components

[Bug]: Sub-menus within a on overlay trigger sp-closed for the outer overlay-trigger element

Open
#4,267 4 comments 0 reactions 0 assignees View on GitHub
API Component:Documentation Component:Overlay SEV missing
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)

overlay-trigger

### Expected behavior

I can listen to `sp-closed` on `overlay-trigger` and only get close events for that trigger

### Actual behavior

If I use sp-action-menu or sp-picker in the overlay rendered by `overlay-trigger`, closing these menus also triggers `sp-closed` for the outer menu. It does look like I can match the `event.target` to the original trigger button, but I could see this really throwing people for a loop.

### How can we reproduce this issue?

I can look at getting a simpler reproduction when I have a bit more time.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the nested overlay-trigger case with sp-action-menu or sp-picker, then inspect the overlay-trigger event handling and how sp-closed is emitted. Done means closing a nested menu no longer emits sp-closed for the outer overlay-trigger, while the original trigger still receives its own close event.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.