Toolbar keyboard navigation: Focus goes to limbo when pop-up panel dismissed
Categories
(Firefox :: Toolbars and Customization, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
(Blocks 1 open bug)
Details
(Keywords: access)
Attachments
(1 file)
STR:
- Press control+l to focus the Location bar.
- Tab to the Library button.
- Press space to activate it.
- Press escape to dismiss the Library menu.
- Expected: Focus should return to the Library button (as in step 2).
- Actual: Focus goes to limbo.
ToolbarKeyboardNavigator removes the tabindex (and thus focusability) of the toolbar button as soon as focus goes elsewhere. This is because we don't want clicking the button to focus it. That means that the PanelMultiView code which returns focus to the previously focused control won't work.
To fix this, we'll need some way to trigger ToolbarKeyboardNavigator's code to "force focus" to the button.
- We could just have PanelMultiView call ToolbarKeyboardNavigator, but this might be a bit ugly because of the coupling it introduces.
- Gijs suggested we could introduce an event which gets fired on the anchor (which should be the toolbar button). I just realised, though, that this will always fire even if the toolbar button wasn't focused, and we only want focus to be restored if the button was already focused.
Assignee | ||
Comment 1•5 years ago
|
||
Toolbar buttons are only made focusable when accessed via the keyboard.
As soon as they lose focus, their focusability is removed.
This is done so that clicking them doesn't focus them.
Previously, this meant that if a panel opened, focus couldn't be restored to the button like it should be when the panel was closed, as the button was no longer focusable.
To work around this, use the open="true" attribute set on the button when the panel opens.
If this is detected, focusability is not removed.
Once focus is restored after the panel closes, things continue as normal.
That is, when the button loses focus for some other reason, its focusability is removed.
Updated•5 years ago
|
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/97ab0fa26acf When a panel is opened from the toolbar via the keyboard, restore focus to the toolbar button when the panel is closed. r=Gijs
Comment 3•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•