Opened 13 years ago

Closed 12 years ago

#2291 closed defect (fixed)

When Tooltip and PopupMenu2 co-exist in a page, PopupMenu2 doesn't collapse when mouse click outside

Reported by: guest Owned by: liucougar
Priority: blocker Milestone: 0.9
Component: Widgets Version: 0.4.1
Keywords: Tooltip, PopupMenu2 Cc: hzhu@…
Blocked By: Blocking:

Description

I have a page that contains both ToolTip? and PopupMenu2 widgets. I access the ToolTip? first, then I expand menu items from the PopupMenu2. Now if I click outside of the PopupMenu2, the menu items don't collapse (or don't respond to any mouse clicks outside). I saw this in FF1.5 and IE6.

Note that if I don't access ToolTip? first PopupMenu2 will work as expected.

Attachments (1)

PopupContainer.js (14.3 KB) - added by guest 13 years ago.
Modified file

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by guest

Attachment: PopupContainer.js added

Modified file

comment:1 Changed 13 years ago by stong@…

You can see the bug in tests/widget/test_Menu2.html included in Dojo 0.4.1 source. First right click the context menu, after that, the menu popup in the main menu can't be clicked away.

I looked into the Dojo code and found the issue was caused by the PopupContainer? manager: it didn't register the latest top level menu if only a submenu was clicked. I came out with a hack to get around the problem, waiting for Dojo team to come out with a better solution.

The modified PopupContainer?.js file is attached.

Basically, I defined a getTopLevel() method in dojo.widget.PopupContainerBase?. And then modified the open() method as followings (line 126):

if(this.isTopLevel){

var topLevel = this.getTopLevel(); if (topLevel) {

var button = dojo.html.isNode(explodeSrc) ? explodeSrc : null;

dojo.widget.PopupManager?.opened(topLevel, button);

}

}

getTopLevel: function() {

var topLevel = this; while (topLevel && !topLevel.isTopLevel && topLevel.parent != null && topLevel.parent.setOpenedSubpopup != undefined) {

topLevel = topLevel.parent;

}

return topLevel;

},

Hope this will help.

comment:2 Changed 13 years ago by stong@…

BTW, the bug can be seen whenever you have more that one top level popup containers (PopMenu2, MenuBar2, Tooltip etc) in your page.

comment:3 Changed 13 years ago by liucougar

Owner: changed from bill to liucougar

comment:4 Changed 13 years ago by liucougar

Milestone: 0.4.2

comment:5 Changed 13 years ago by liucougar

Resolution: fixed
Status: newclosed

can not reproduce this in neither 0.4 branch nor trunk, closing this

comment:6 Changed 13 years ago by guest

Resolution: fixed
Status: closedreopened

This is very much reproducible with out of box sample of 0.4.2 and 0.4.3 too.

  1. Open dojo/tests/widget/test_Menu2.html in a browser (Firefox).
  2. Mouseover or click Edit menu to see a popup sub menu.
  3. Click else where on the page. The menu closes back which is expected.
  4. Now right click anywhere on the page to see a context popup menu and close it by clicking elsewhere.
  5. Now follow step #2 above to see the Edit sub menu.
  6. Click elsewhere on the page. You will see tha the menu does not close. Worse yet is that you can open a context menu while the popmenu from the menubar is still open.

comment:7 Changed 12 years ago by bill

Milestone: 0.4.20.9
Resolution: fixed
Status: reopenedclosed

OK, this is fixed in 0.9.

Note: See TracTickets for help on using tickets.