adobe / adobe/spectrum-web-components

[Bug]: sp-menu - when sp-menu-items are rendered in a lit elements shadow dom, the items are not accessible with the keyboard

Open
#6,540 4 comments 0 reactions 0 assignees View on GitHub
a11y bug Component:Menu SEV 4 triage
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-menu, sp-menu-item

### Library version

1.9.0

### Expected behavior

When using lit, if sp-menu-item elements are rendered in a shadow dom they should remain accessible without requiring the component to back out of the shadow dom which is custom to lit elements

### Actual behavior

Since sp-menu-item are in the shadow dom they are not accessible from sp-menu

Items were invisible to sp-menu. StudioMenuLevelElement rendered its sp-menu-items into a shadow root. sp-menu discovers its items by descending one level into non-item children via querySelectorAll(':scope > *') — light DOM only. Items behind the wrapper's shadow root were never found, so sp-menu had zero registered items → no roving tabindex, no focus-on-open, no arrow nav. (The items still rendered — slot projection is passive — they just weren't registered, which is what keyboard nav walks.)

### Screenshots

_No response_

### What browsers are you seeing the problem in?

Chrome

### How can we reproduce this issue?

### Sample code or abstract reproduction which illustrates the problem

Have the DOM tree look like the following. sp-menu when using the keyboard can not find the sp-menu-items properly

sp-menu
custom-lit-element
#shadow-root
sp-menu-item
sp-menu-item

### Severity

SEV 4

### Logs taken while reproducing problem

_No response_

### Would you like to track this issue in Jira?

- [ ] Yes, please tell me the ticket number!

Contributor guide

Open the contributing guide

Research direction

Start with the sp-menu item-discovery entry point and the sp-menu-item registration behavior described in the issue, using the nested custom-lit-element shadow-root DOM as the reproduction. Confirm that items inside the shadow root are discovered and registered, then verify that roving tabindex, focus on open, and arrow-key navigation work for the rendered items.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.