Closed Bug 2017668 Opened 2 months ago Closed 2 months ago

[macOS] Multiple popover panel-list elements can appear and overlap each other

Categories

(Toolkit :: UI Widgets, defect, P3)

defect

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox149 --- disabled
firefox150 --- fixed

People

(Reporter: tgiles, Assigned: tgiles)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [recomp])

Attachments

(3 files)

We added popover support to our panel-list in Bug 2010864, and utilized the popover='manual' approach to simplify the toggling logic of the panel-list. While the panel-list popover behaves as expected on Windows and Linux, where there is only one popover panel-list visible at any time, this is not true for macOS.

STR:

  1. Use macOS or modify moz-select.mjs so that the arrow keys case always toggles the panel.
  2. Go to the Applications section in about:preferences
  3. Click on one of the select elements, it's popover panel-list should open.
  4. Click on a different select element, the first panel-list should close and the second should open
  5. Press the up or down arrow key

Expected: The first or last option in the second panel-list is selected.
Actual: The first or last option in the second panel-list is selected, and the first panel-list is re-opened

Previously, the moz-select handler would always steal focus when its
panel closed through the handlePanelHidden() function. Now the focus
only returns to the panel trigger when there's no active element, the
active element is the body, or if the active element is the associated
moz-select. Without this change, it would be possible to click on two
different moz-select elements and then pressing the up or down arrow key
would close the second panel-list and reopen the first one. The expected
behavior is that arrow keys would start to select options in the open
panel-list, not close the open panel-list and open a different
panel-list.

Controlling via singleton no longer relevant due to "auto" behavior
WIP: Bug 2017668 - Ensure only one panel-list is visible via singleton

This simplifies the state management and makes the popovers behave more
consistently. By utilizing the popovertarget on the HTML trigger
buttons in both moz-button and moz-select, we prevent the "clicking
causes the panel-list to open and then immediately close"" issue. Since
the panel trigger buttons had no popovertarget, the browser treated
every click as an "outside the popover" click and dimissed the popover.
This was the issue we were trying to work around by using the manual
behavior of popovers.

With these changes, the panel-list popovers behave more like the native
HTML select dropdown elements. There's still an improvement to be made
by allowing "mouseup" to select an element in the dropdown that appears,
but that is out of scope for this bug. For example, "mousedown" to open
the panel-list, continue holding the mouse down until you find the
option you want, then letting go of the mouse button to select the
hovered element.

Attachment #9546945 - Attachment description: Bug 2017668 - Fix focus stealing when panel-list is hidden. r=#recomp-reviewers → WIP: Bug 2017668 - Fix focus stealing when panel-list is hidden. r=#recomp-reviewers
Attachment #9546946 - Attachment description: Bug 2017668 - Use auto behavior for panel-list popovers. r=#recomp-reviewers → WIP: Bug 2017668 - Use auto behavior for panel-list popovers. r=#recomp-reviewers

Add comment about Mac panel trigger focus, restore handlePanelHidden
changes, move hideListeners initialization to prevent issues with
popover auto behavior.

Attachment #9546945 - Attachment description: WIP: Bug 2017668 - Fix focus stealing when panel-list is hidden. r=#recomp-reviewers → Bug 2017668 - Fix focus stealing when panel-list is hidden. r=#recomp-reviewers
Attachment #9546946 - Attachment description: WIP: Bug 2017668 - Use auto behavior for panel-list popovers. r=#recomp-reviewers → Bug 2017668 - Use auto behavior for panel-list popovers. r=#recomp-reviewers
Attachment #9547630 - Attachment description: WIP: Bug 2017668 - Focus panelTrigger on mousedown for Mac only. r=#recomp-reviewers → Bug 2017668 - Focus panelTrigger on mousedown for Mac only. r=#recomp-reviewers
Duplicate of this bug: 2018563
No longer duplicate of this bug: 2018563
See Also: → 2018563
Duplicate of this bug: 2020366

Would that land in time for a beta uplift? Thanks

Flags: needinfo?(tgiles)

Since the dependent bug has been backed out on 149, I believe we no longer need to uplift this to beta 149.

Flags: needinfo?(tgiles)
Blocks: 2022047
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Duplicate of this bug: 2018563
Blocks: 2018563
No longer duplicate of this bug: 2018563
See Also: 2018563
No longer duplicate of this bug: 2020366

The popover support that was added to panel-list in bug 2010864 was backed out of Beta, so marking 149 disabled.

Regressions: 2018967
QA Whiteboard: [qa-triage-done-c151/b150]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: