Opened 14 years ago
Closed 14 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: | [email protected]… |
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)
Change History (8)
Changed 14 years ago by
Attachment: | PopupContainer.js added |
---|
comment:1 Changed 14 years ago by
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 14 years ago by
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 14 years ago by
Owner: | changed from bill to liucougar |
---|
comment:4 Changed 14 years ago by
Milestone: | → 0.4.2 |
---|
comment:5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
can not reproduce this in neither 0.4 branch nor trunk, closing this
comment:6 Changed 14 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This is very much reproducible with out of box sample of 0.4.2 and 0.4.3 too.
- Open dojo/tests/widget/test_Menu2.html in a browser (Firefox).
- Mouseover or click Edit menu to see a popup sub menu.
- Click else where on the page. The menu closes back which is expected.
- Now right click anywhere on the page to see a context popup menu and close it by clicking elsewhere.
- Now follow step #2 above to see the Edit sub menu.
- 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 14 years ago by
Milestone: | 0.4.2 → 0.9 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
OK, this is fixed in 0.9.
Modified file