Closed Bug 1752687 Opened 2 years ago Closed 2 years ago

Firefox browser won't focus on web component, while all other browsers do.

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

Firefox 91
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: istvan.tutto, Unassigned)

References

(Blocks 1 open bug, )

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Steps to reproduce:

Created a Web component and tried calling the webcomponent.focus() to focus the element:

https://codepen.io/istutto/pen/XWzmdoW

FF: 91.5.1esr (64-bit)
On Mac (Catalina, 10.15.7)

Actual results:

The javascript focus() method called on a web component will not focus the element nor the the element inside.

Expected results:

All other major browsers behave as expected:
The web component gets focused the same as any other element.

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.

Component: Untriaged → DOM: UI Events & Focus Handling
Product: Firefox → Core
See Also: → 1751253

I confirmed this issue on Fx 98 nightly, too.
Sean, this issue sounds quite fundamental. Do you have ideas what's up here?

Blocks: shadowdom
URL: 1739154
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(sefeng)

On Firefox 91 we didn't support delegatesFocus so it's expected it doesn't work. On Nightly the button is focused (you can see it with :focus { outline: 2px red } or so), but since it was focused via mouse it doesn't show focus rings.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(sefeng)
Resolution: --- → INVALID

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

On Firefox 91 we didn't support delegatesFocus so it's expected it doesn't work. On Nightly the button is focused (you can see it with :focus { outline: 2px red } or so), but since it was focused via mouse it doesn't show focus rings.

A-ha, okay, now I see it. Thanks :)

Thank you for looking into this. I thought I was on the latest FF version as it showed that it was up to date.
After the manually downloading a new version, everything works as expected.

You need to log in before you can comment on or make changes to this bug.