Opened 11 years ago

Closed 10 years ago

#8624 closed defect (fixed)

MenuBar: lost focus on menu click

Reported by: bill Owned by: Douglas Hays
Priority: high Milestone: 1.4
Component: Dijit Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

In test_Menu.html, if you click cut/copy/paste from the Edit menu of the top MenuBar, and then hover over the MenuBar again, it will open up the menu.

MenuBar still thinks it is active because it didn't get an _onBlur() event.

And the reason there was no _onBlur() event is because after the drop down menu closed... focus has gone nowhere (or perhaps to the document itself).

Seems like focus should go somewhere, maybe to the MenuBarItem?

Change History (9)

comment:1 Changed 11 years ago by bill

Milestone: tbd1.4

Let's think about this for 1.4.

Maybe we just tell developers that their onClick handlers are responsible for putting focus somewhere? Or could focus back to the MenuBarItem, although that would then open the submenu again, which would look strange.

comment:2 Changed 10 years ago by Douglas Hays

Owner: set to Douglas Hays

Fixing as part of a bigger Menu enhancement originating from #6773. Also, MenuBar? menus act differently and close the dropdown menu on the 2nd click of the MenuBar? item.

comment:3 in reply to:  2 Changed 10 years ago by bill

Replying to doughays:

Fixing as part of a bigger Menu enhancement originating from #6773.

OK thanks.

Also, MenuBar? menus act differently and close the dropdown menu on the 2nd click of the MenuBar? item.

That's how menu bars on windows and mac work too. I'm wouldn't consider it a bug. I don't think it matters much either way though, probably whatever is simpler to code is fine.

comment:4 Changed 10 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [20098]) Fixes #6773, #8624, #9846 !strict. Added ESC keydown handling in the popup manager for WebKit? so menus can be closed with the keyboard. Added a pending-close state to menus so if the mouse touches something else but moves back to a target menu, then the close is cancelled. Added ability to close MenuBar? menu's by reclicking the menubar item to be consistent with other applications. Collpased multiple deferred focus events to prevent incorrect blurring. Added numerous automated tests to demonstrate changed behavior. All tests ran on WIndows. Mac is currently experiencing robot issues. Removed the Hover CSS style if the keybaord is used to select a different item in the same menu after moving the mouse to hover a slibling item to prevent multiple menu selections. Removed isActive after a menu item is selected or on a menu blur event so the menu doesn't popup again on subsequent hovering. Removed _onFocus handling from Menu since it can fire after a menu has closed and now isActive is set from onItemClick.

comment:5 Changed 10 years ago by bill

Resolution: fixed
Status: closedreopened

Please re-enable the test-case in Menu_mouse.html (search for #8624 in that file), or remove/update it if the current (commented out) test is invalid.

comment:6 Changed 10 years ago by bill

(In [20275]) Make comments unique so we can tell which doh.t() call is failing. Refs #8624.

comment:7 Changed 10 years ago by bill

I'm also getting failures in Menu_mouse.html on IE6 at revision [20098], specifically "error already called". Do you get those?

comment:8 Changed 10 years ago by Douglas Hays

The "already called" exceptions are due to #9805 at revision [20187].

comment:9 Changed 10 years ago by Douglas Hays

Resolution: fixed
Status: reopenedclosed

(In [20289]) Fixes #8624. Restore automated test.

Note: See TracTickets for help on using tickets.