panel-list submenu opens off screen at certain viewport sizes when accessed via keyboard navigation
Categories
(Toolkit :: UI Widgets, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: hjones, Assigned: tgiles)
References
(Blocks 1 open bug)
Details
(Whiteboard: [recomp])
Attachments
(3 files, 1 obsolete file)
I can reproduce this 100% of the time on MacOS when I am running Firefox at full width. STR:
- make sure Firefox is full width
- navigate to Firefoxview
- use the keyboard to open one of the menus
- use the right arrow key to open the submenu
expected results:
the submenu opens to the left of the main panel so that it's fully visible on screen. This is what happens when you hover over the option/use the cursor to open the submenu.
actual results:
the submenu always opens to the right of the panel meaning the options are always partially obscured
Updated•2 months ago
|
| Reporter | ||
Comment 1•2 months ago
|
||
This seems like a related issue - at slightly smaller browser widths trying to open the menu via the keyboard just causes it to auto close and triggers a strange layout shift/flash
| Assignee | ||
Comment 2•2 months ago
|
||
Might be related to the popover API changes, I need to confirm one way or the other.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 3•2 months ago
|
||
When a submenu was opened with the keyboard at viewport sizes where the
page can scroll horizontally, it would flash open and immediately close.
The submenu's ArrowRight/ArrowLeft handler did not preventDefault, so the
arrow key would scroll the page and then the scroll-hide listener would
dismiss the menu.
We add preventDefault to the submenu open and close key branches, since
this is already done for ArrowDown/ArrowUp/Tab.
Includes regression tests for the arrow-key scroll dismissal in both LTR
and RTL, where the open and close keys are swapped.
| Assignee | ||
Comment 4•2 months ago
|
||
A submenu opened by keyboard near the right viewport edge could open
off-screen. setSubmenuAlign() measured the submenu bounds in a single
requestAnimationFrame, but on the keyboard path the submenu content was
not laid out yet, so its width read as 0 and the overflow check chose the
wrong side. This race is timing-dependent and surfaced on macOS but not
Windows, though measuring before layout is wrong regardless.
We defer the measurement with requestAnimationFrame + setTimeout to match
setAlign(), and replace the align-attribute heuristic with an explicit
check of the space available on each side so the submenu opens where it
actually fits. topOffset is also rounded to avoid sub-pixel artifacts,
matching setAlign().
Includes regression tests for the keyboard submenu positioning in both
LTR and RTL.
Updated•1 month ago
|
Updated•1 month ago
|
Comment 6•1 month ago
|
||
| bugherder | ||
Updated•22 days ago
|
Description
•