#16300 closed defect (fixed)
MenuBar: tabIndex problems after focusing programatically
Reported by: | hyang | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9 |
Component: | Dijit | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
1: get test_Menu.html source code under folder dijit\tests
2: add method below to move focus to menubar with CTRL+M
function addListenerToDoc(event){ if(event.ctrlKey && event.charCode == 109){//Ctrl+M var menubar = dijit.byId('menubar'); var menu = dijit.byId('file'); if(menubar && menu){ menubar._markActive(); if(menubar.focusedChild) return; menubar.focusChild(menu); if(menu.popup) menubar._openPopup(); } } }
3: call the method in addOnLoad
4: browser the page, and press CTRL+M to move focus to menubar
5: press ESC to close the popup, the focus on the file menu
6: press Shift+ tab
Defect: the focus still on the file menu
Attachments (1)
Change History (4)
Changed 8 years ago by
Attachment: | test_Menu.html added |
---|
comment:1 Changed 8 years ago by
Description: | modified (diff) |
---|---|
Milestone: | tbd → 1.9 |
Status: | new → assigned |
Summary: | move focus to menubar with keyboard, and focus does not move in some case → MenuBar: tabIndex problems after focusing programatically |
Hmm, yes, Menu (and anything derived from _KeyNavContainer) is not designed to get focus programatically.
Originally the container has a tabIndex, and when it receives focus via the tab key, it immediately shifts focus to it's first child, and sets it's own tabIndex to -1 (or removes it's tab index). This is what _onContainerFocus() does.
But in this case _onContainerFocus() isn't called, so the shift-tab moves from the File MenuItem to the container itself.
source code