Open Bug 1877410 Opened 2 years ago Updated 2 months ago

When click to open addon's popup the input field that have to focus sometimes doesn't get the focus

Categories

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

Firefox 122
defect

Tracking

()

UNCONFIRMED

People

(Reporter: chris_bestas, Unassigned)

References

Details

Attachments

(2 files)

Attached file test.zip

Steps to reproduce:

load the add on in the attached file. When clik the icon to open the popub, the input field don't take always the focus, as it should be.

Actual results:

So, if press the tab key the input field get the focus, but if move the mouse the field loose the focus again. I set a shortcut key compination to open the addon's popup and all times i use it the field is focusing. The problem exist when open the popub by clicking the icon.

Expected results:

The input field with id "aanum" in the example, should get focus after opening the popup.

Summary: When click to open addon's popup the input field that have to focus sometimes don't get the focus → When click to open addon's popup the input field that have to focus sometimes doesn't get the focus
Component: Untriaged → DOM: UI Events & Focus Handling
Product: Firefox → Core

Works for me on Nightly on Ubuntu running in Wayland mode on Wayland.

Reporter, does the bug reproduce on Nightly for you? On which platform?

Flags: needinfo?(chris_bestas)

Tested on Windows 10 and Windows 11 and has the same problem. As I mentioned sometimes it focuses and sometimes it doesn't.

Flags: needinfo?(chris_bestas)
Severity: -- → S3
Attached video missing focus example

The bug is 100% there, it's just harder to reproduce, since trying it more just makes it cached more and the race condition will almost never happen.

BUT! If you open another addon popup first, then there is much bigger chance to reproduce it.
See the video where clicking to Auto Highlight addon first, will almost always cause the Send Note to Device to not focus the input.

This bug is here for years, and it was fixed already few years back:
https://bugzilla.mozilla.org/show_bug.cgi?id=1324255

I just wanted to add that I have run into this issue with 2 of my Firefox addons trying to use "autofocus" on a specific input element.

Discussion of this including screenshots and videos: https://discourse.mozilla.org/t/use-of-autofocus-in-popup-html-not-consistent/143017

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

Attachment

General

Creator:
Created:
Updated:
Size: