Opened 14 years ago
Closed 14 years ago
#1978 closed defect (fixed)
Popup widget don't show at the right position.
Reported by: | Owned by: | bill | |
---|---|---|---|
Priority: | high | Milestone: | 0.9beta |
Component: | Widgets | Version: | 0.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I'm using Dojo 0.4 and Firefox 2.0
All widgets in my page that use dojo.widget.PopupContainerBase? internally don't show up at the right position, only at the first time (always shift 8px to the left). Maybe because all my widget tag is in td like this.
<td><div dojoType="xxx" /></td>
It didn't happen to other widget such as combobox in "test_combobox.html". After debugged, I found a line of code that cause the problem. It's line 147 of "PopupContainer?.js"
display="";
It causes the "x" value return by "document.getBoxObjectFor(node)" (which is called in "dojo.html.getAbsolutePosision") reduce by 8. I just commented that code and the problem gone. The popupwidget on the others page still work correctly but I only tested it in Firefox.
Do other browser need that line of code and what is the purpose of it in the first place. The comment say that "display temporarily, and move into position, then hide again" but I don't any position related style only zIndex one.
Regard
Wara
Attachments (1)
Change History (7)
comment:1 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 Changed 14 years ago by
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
I've been investigating further. By using your debug method, http://dojo.jot.com/DebuggingJavascript very nice article ;-) I've found what cause this anomaly.
My widget(s) reside within DIV(container) that has "margin-left" and "margin-right" set to "auto". When set popup domNode's display-style to empty string.
with(this.domNode.style){ display=""; zIndex = this.beginZIndex + this.popupIndex; }
Because the hight of the entire content is about to exceed the viewport height. When popup domNode display, the scrollbar appear and the DIV(container) is slightly shift to the left. Later the popup domNode style is set to "none" and the scrollbar is disappeared. The problem is display position is calculate when the scrollbar is shown but the popup is shown when scrollbar is hidden. That's why the popup is shift by 8px every time.
Can we solve this problem by put popup's domNode to position (0,0) before set display-style to empty string by using
this.move(0, 0, null, null)
But for me I still comment the line
display=""
Because I only use firefox and so far it don't break anything.
Regard
Wara
PS.
I don't know you guys will look at response in old-closed tickets again so I re-opened it. :)
comment:4 Changed 14 years ago by
Thank you for your attention.
This is the testcase just put it in "dojo/tests/widget/"
Regards
Wara
comment:5 Changed 14 years ago by
Milestone: | → 0.9 |
---|
comment:6 Changed 14 years ago by
Milestone: | 0.9 → 0.9beta |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
I believe this is fixed in [8741] of place.js (in the dijit tree), which sets visibility:hidden while calculating the size, thus not causing scrollbars to appear.
In order to position the popup widget, we need to know it's size. In order to know it's size, we need to make it visible. (Browser limitation)
Not sure what your issue is exactly. You haven't attached a testcase. But in any case I doubt that we will be able to support sticking popups inside a table.