Accessibility · Senior · Question 10 of 75
Why does aria-labelledby fail across a Shadow DOM boundary?
- 1Browsers block all focus inside of a shadow root
- 2ID references resolve only within one tree scope
- 3Shadow DOM removes all ARIA attributes at render
Show the answer
Correct answer: ID references resolve only within one tree scope
Explanation
An id in the light DOM isn't visible from within a shadow root. Workarounds are keeping label and input together or using element reference APIs where supported.