Firefox erroneously displays focus ring on a web component when the host has a focus ring defined and any internal item has received focus
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: elliot.nahman, Unassigned)
References
Details
Steps to reproduce:
I created a web component with focusable elements inside (eg a button) and I defined a focus state on the host (eg :host(:focus) { outline: 4px solid red; })
Codepen with examples: https://codepen.io/nonmetalhail/pen/QWqXNQp
Actual results:
Tabbing to focus on the button inside the the web component causes the host to display its focus ring in addition to the button focus ring.
Expected results:
Only the button focus ring should be displayed.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
You want to use :focus-visible
. This is per spec, see https://html.spec.whatwg.org/#selector-focus. Safari matches our behavior, this is a Chrome bug.
Updated•3 years ago
|
Description
•