Closed Bug 1546633 Opened 5 years ago Closed 5 years ago

Can't open buttons with subviews in overflow panel

Categories

(Firefox :: Toolbars and Customization, defect, P1)

68 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 68
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- unaffected
firefox67 --- unaffected
firefox68 --- fixed

People

(Reporter: Gijs, Assigned: Jamie)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Looking for a regression window, but basically, str:

  1. pin library button in the overflow menu
  2. tab to overflow buton
  3. hit space/enter
  4. navigate to library button if necessary (with tab/arrow)
  5. hit space/enter/right-arrow

ER:
open subview

AR:
no subview

Looks like bug 1477673.

Regressed by: 1477673
Priority: -- → P1

Curiously, this doesn't happen for the Forget button (panic-button), but does for the Library button.

Ug. I almost wish I hadn't opened this can of keyboard worms. :(

This didn't happen before bug 1477673 because we didn't use PMV key nav for the overflow panel before then.

I think this happens because:

  1. library-button explicitly defines onmousedown and onkeypress events, but not oncommand. (I guess it needs to do mousedown to support drag, and because of that, it needed keypress to manage setting panel focus properly, since we're not relying on CustomizableUI to do that.)
  2. PMV key nav (which runs on keydown, thus before library-button's keypress) simulates a command event and a click event. It does not simulate a mousedown event.

The intuitive fix is to change library-button's keypress handler to keydown so it runs before PMV keydown. Unfortunately, that would mean focus wouldn't be set properly when opening this from the overflow menu with the keyboard, since that needs to be handled within PMV key nav.

Another option is to change PanelMultiView.showSubView to take a boolean isKeyPress argument (or an event argument) and have PanelUI.showSubView pass that. This would be another way to trigger the initial focus behaviour for sub-views.

Gijs, thoughts?

Flags: needinfo?(gijskruitbosch+bugs)

Oh, a third option is to add an oncommand handler to library-button. However, I'm not sure how that would interact with the existing mousedown and keypress handlers. In particular, the command event handles keyup for space, not keydown or keypress, which might cause some pain; I ran into a bunch of trouble with that when working on toolbar key nav.

(In reply to James Teh [:Jamie] from comment #3)

Another option is to change PanelMultiView.showSubView to take a boolean isKeyPress argument (or an event argument) and have PanelUI.showSubView pass that. This would be another way to trigger the initial focus behaviour for sub-views.

I realised that only works if you change library-button's keypress handler to a keydown handler. And:

The intuitive fix is to change library-button's keypress handler to keydown so it runs before PMV keydown.

PMV keydown is a capturing handler, so it doesn't matter what we do, library-button's handlers will never run first.

Previously, we sent a command event and a click event.
Normally, the command event executes the action, then the click event closes the menu.
However, in some cases (e.g. the Library button), there is no command event handler and the mousedown event executes the action instead.

I've r+'d the patch so I think I can clear this, let me know if I missed something.

Flags: needinfo?(gijskruitbosch+bugs)
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/041741ce1646
PanelMultiView: Send mousedown event when activating a button via the keyboard. r=Gijs
Flags: needinfo?(jteh)
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f6903c331545
PanelMultiView: Send mousedown event when activating a button via the keyboard. r=Gijs
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Assignee: nobody → jteh
Regressions: 1584781
No longer regressions: 1584781
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: