#10339 closed defect (fixed)
Menu: dijitMenuItemHover & dijitMenuItemSelected not removed
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.4.0b |
Keywords: | Cc: | Becky Gibson | |
Blocked By: | Blocking: |
Description
(From Joscha Falc Feth, IBM)
When using a popupMenu within a dijit.Menu nad using onClick to for example open a dialog, the
- dijitMenuItemHover does not get removed on IE > 6
- dijitMenuItemHover and dijitMenuItemSelected does not get removed on FF3
I attached an example file with a workaround. Please disable the workarounds to check the issue on FF3 and IE7 & 8.
Attachments (2)
Change History (8)
Changed 11 years ago by
Attachment: | exampleMenu.html added |
---|
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Milestone: | tbd → 1.5 |
---|
comment:3 Changed 11 years ago by
comment:4 Changed 11 years ago by
comment:5 Changed 11 years ago by
Cc: | Becky Gibson added |
---|---|
Milestone: | 1.5 → 1.4 |
Resolution: | → fixed |
Status: | new → closed |
Actually [20951] also fixed the dijitMenuItemHover problem on IE, so IE is working perfectly for 1.4.
dijitMenuItemSelected is still lingering on FF. Actually, the class disappears when the dialog is shown but *reappears* when the Dialog is closed, because the Dialog is trying to refocus the MenuItem that spawned it. That's not good, since the Menu itself is hidden.
Would be nice if Dialog could automatically detect if one of the ancestors of the refocus node was hidden... apparently you can check the node's offsetWidth and offsetHeight, and if they are 0 it means that the node is hidden. But that apparently doesn't work for tr/td in some cases (which is what Menu uses), so it doesn't sound like a workable solution. And also, for a11y reasons there should be code somewhere to reset focus somewhere sensible after dialogs launched from context menus are closed.
Anyway, by using 1.4 and then setting refocus: false
on your dialogs, this works on all browsers. Attaching new test case showing it working, and closing this ticket.
Changed 11 years ago by
Attachment: | exampleMenu14.html added |
---|
working example (without workarounds) against 1.4
comment:6 Changed 11 years ago by
PS: there's a TODO in MenuItem.js to fix the focus manager to track focus/blur events on MenuItems, and then cleanup the MenuItem code to take advantage of that. When that TODO is fixed there probably won't be a lingering dijitMenuItemSelected class, even if Dialog does try to refocus the hidden context menu.
Regardless, Dialog trying to focus a hidden context menu is worrisome. We've had lots of problems on IE with hiding the node that has focus, although maybe there's no issue with trying to focus a node that's already hidden.
Please note: The Fix for FF3 already got disabled in the example attachment. To test it, it needs to be *enabled*.