Opened 10 years ago

Closed 10 years ago

#9140 closed defect (fixed)

MenuBar: Runtime Error in Menu.js when moving cursor to menu item w/no popup

Reported by: Yves De Bruyne Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

In the function _openPopup, when hovering over a MenuBarItem, you get an error because the item in question has no 'popup' object.

I solved this locally by adding an additional check

[Menu.js]

162		var popup = from_item.popup;

+++		if (!popup) { return; }

164		if(popup.isShowingNow){ return; }

Not sure if this is the right solution or if MenuBarItem is derived from the wrong class...

Attachments (1)

menubarbug.html (1.1 KB) - added by Yves De Bruyne 10 years ago.
Refactored names to make example clearer

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by bill

Can you give a test case or steps to reproduce in test_Menu.html?

I've hovered over MenuBarItem's before with no problems.

Which browser?

comment:2 Changed 10 years ago by Yves De Bruyne

I've not been able to reproduce it on the test_Menu.

I've attached a simple version of my code (really tiny). I get a JavaScript? error when I open the "Directories" Submenu, then move to "Web Mail" item.

I've tried this on Firefox 3 and Internet Explorer7.

comment:3 Changed 10 years ago by bill

OK, thanks for the test case. Not sure if this is the cause of your problem, but why are you adding a MenuBarItem widget to a Menu?

pMetaMenu.addChild(new dijit.MenuBarItem({
    ...

That's invalid.

Changed 10 years ago by Yves De Bruyne

Attachment: menubarbug.html added

Refactored names to make example clearer

comment:4 Changed 10 years ago by Yves De Bruyne

I'm not sure I do... I reuploaded the file with new variable names to clear up the confusion... I took it almost verbatim out of my project before...

1) Create Menubar 2) Create Submenu 3) Add Item so the submenu

4) Add submenu to the Menubar 5) Add plain item to the menubar

Still stuggling with the docs though... My project has moved to using the parser to instantiate the menu, but I'd like to nail down this error so I can sleep at night :-)

Cheers

comment:5 Changed 10 years ago by bill

Description: modified (diff)
Milestone: tbd1.4
Owner: set to bill
Status: newassigned
Summary: Runtime Error in Menu.jsMenu: Runtime Error in Menu.js when moving cursor to menu item w/no popup

Ah OK I see it now.

The problem happens when the user is hovering over a menu item with a sub-menu (that is open), and then the user moves the cursor over a menu item w/out a submenu.

Thanks for the test case and the bug report. I'll fix.

comment:6 Changed 10 years ago by bill

Summary: Menu: Runtime Error in Menu.js when moving cursor to menu item w/no popupMenuBar: Runtime Error in Menu.js when moving cursor to menu item w/no popup

comment:7 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [17311]) Don't try to automatically open the sub-menu for a MenuBarItem? w/out a sub-menu. Fixes #9140 !strict.

Note: See TracTickets for help on using tickets.