Opened 6 years ago

Closed 6 years ago

#16904 closed defect (fixed)

[regression] MenuBar: keyboard navigation problems after accessing submenu via Enter key/mouseclick

Reported by: spaquette Owned by: bill
Priority: undecided Milestone: 1.9
Component: Dijit Version: 1.9.0a2
Keywords: Cc:
Blocked By: Blocking:


In the most current master, navigation with the up/down arrow keys, selecting menu items with access keys, and closing of the submenu with the Escape key stop working after using the Enter key or a mouseclick to open a MenuBar? item's submenu. Using the left/right arrow keys returns expected keyboard functionality by moving the focus to another MenuBar? item (and if it has it, opening the submenu and selecting its first item).

I've attached a test file which is a version of the MenuBar? 1.8 Demo with two extra submenus to help me confirm some things, but that Demo itself should show this behavior if run against the master.

To see what's happening, open a submenu of a MenuBar? item using either Enter or a mouseclick. If using the mouse, leave it over the MenuBar? item (i.e. don't let it move over the submenu).

Observed behaviors:

  • The submenu opens, however, the first item in the submenu isn't highlighted, up/down arrow keys don't start traversal of the submenu items, and escape doesn't close the submenu.
  • If defined, access keys for that submenu don't appear to respond.
  • If the submenu has a PopupMenuItem? which you open by clicking with the mouse or Enter, the first popup menu item won't highlight, and you cannot start traversal of the popup items with up/down arrow keys. However, the up/down arrows will traverse the parent submenu, and Escape will close the parent MenuBar? submenu.

Attachments (1)

test_menubar_keyboard.html (3.0 KB) - added by spaquette 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by spaquette

Attachment: test_menubar_keyboard.html added

comment:1 Changed 6 years ago by bill

Milestone: tbd1.9
Status: newassigned
Summary: MenuBar keyboard navigation problems after accessing submenu via Enter key/mouseclick[regression] MenuBar: keyboard navigation problems after accessing submenu via Enter key/mouseclick

Good catch.

I'll definitely fix the ENTER key handling to work like 1.8, although I note that down arrow is still better for users since it focuses the first submenu item, whereas ENTER key does not, at least not in 1.8. Seems like it should.

As for clicking with the mouse and then pressing down arrow, it doesn't seem as important to support, but I'll take a look anyway.

comment:2 Changed 6 years ago by spaquette

Definitely agree Mouse + Down Arrow is not really a priority; I was just including it in case it helped with diagnosis, since I stumbled across it. I'd expect most users would be going all-mouse or all-keyboard, rather than a kind of hybrid like that.

comment:3 Changed 6 years ago by bill

Resolution: fixed
Status: assignedclosed

In [31004]:

Make a11yclick indicate the real event type so that _MenuBase can differentiate between keyboard and mouse clicks, the former of which should focus the popup menu. Fixes #16904 !strict, although I could add more code to make ESC and down arrow work even when the dropdown menu was opened by the mouse.

Note: See TracTickets for help on using tickets.