Closed Bug 1619271 Opened 4 years ago Closed 2 years ago

Element still remains focused after it goes to visibility: hidden

Categories

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

defect

Tracking

()

RESOLVED DUPLICATE of bug 1740989
Tracking Status
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- fix-optional
firefox76 --- affected
firefox77 --- affected
firefox78 --- affected
firefox79 --- affected
firefox80 --- affected
firefox96 --- affected

People

(Reporter: ailea, Unassigned)

References

()

Details

Attachments

(3 files)

Affected versions:

ALL

Affected platforms:

ALL

Steps:

  1. Launch Firefox with a new profile access: http://theswishlife.com/
  2. Scroll down and then click on the "Go to the top" red button (Bottom right).
  3. Scroll down again.

Actual result:

The "Go to the top" button remains black (focused) after step 3, like the button is still pressed.

Expected result:

The "Go to the top" button should become red again.

The issue is not reproducible on Chrome.
Please see the video attachment for a better understanding.

Regression range:

This is not a recent regression. The issue is also reproducible on Fx 65.

Focus traversal behavior suggests that the button remains focused in Chrome, too. I don't see a reason why focus wouldn't remain there. Since the styling differs, sending over to style system.

Status: NEW → RESOLVED
Closed: 4 years ago
Component: DOM: UI Events & Focus Handling → CSS Parsing and Computation
Resolution: --- → FIXED
Attached file Testcase

Pretty sure this is a focus handling issue. Here's a reduced test-case.

The element goes to visibility: hidden (which makes it unfocusable), and back again. We keep the focus but Chrome removes it. Not 100% clear what's the right thing to do here.

Status: RESOLVED → REOPENED
Component: CSS Parsing and Computation → DOM: UI Events & Focus Handling
Resolution: FIXED → ---
Priority: -- → P3

Hi,

I was able to reproduce this issue on Ubuntu 18 with Firefox version Nightly 76.0a1 (2020-03-17) (64-bit). Marking that flag as affected.

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

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

Created attachment 9130406 [details]
Testcase

Pretty sure this is a focus handling issue. Here's a reduced test-case.

The element goes to visibility: hidden (which makes it unfocusable), and back again. We keep the focus but Chrome removes it. Not 100% clear what's the right thing to do here.

Edgar, do you have thoughts about the right behavior here?

Flags: needinfo?(echen)

Per https://html.spec.whatwg.org/#focus-fixup-rule, this is a Gecko bug.

In a Document whose focused area is a button element, removing, disabling, or hiding that button would cause the page's new focused area to be the viewport of the Document. This would, in turn, be reflected through the activeElement API as the body element.

Flags: needinfo?(echen)

Hi,

I've tested this using Firefox Nightly version 77.0a1 (2020-04-13) (64-bit) for windows 7 x64 and I’m also able to reproduce the issue. Based on this I will mark each respective flag as affected.

Best,
Raluca

Latest Nightly 78 is also affected, updating flags.

Change the status for beta to have the same as nightly and release.
For more information, please visit auto_nag documentation.

See Also: → 1650092
Summary: The "go to the top" button remains focused after clicking on it → Element still remains focused after it goes to visibility: hidden
Status: REOPENED → RESOLVED
Closed: 4 years ago2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: