Opened 10 years ago
Closed 8 years ago
#13604 closed defect (fixed)
dijit/popup::moveOffScreen() can cause horizontal scroll bar
Reported by: | yuanyuan | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.9 |
Component: | Dijit | Version: | 1.5 |
Keywords: | popup menu, visibility, scroll bar | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
In the file popup.js under the path dijit\_base, there are codes as below. The code section shows that the popup menu is hidden with that the top is value -9999px and the visibility is hidden.
moveOffScreen: function(/*Widget || DomNode*/ widget){ var wrapper = widget.declaredClass ? widget._popupWrapper :(dojo.hasClass(widget.parentNode,"dijitPopup") && widget.parentNode), node = widget.domNode || widget; if(wrapper){ dojo.style(wrapper, { visibility: "hidden", top: "-9999px" }); }
Actually the "left" value should be assigned when the popup menu is hidden. Because the "visibility: "hidden"" shows that the popup menu occupies the space where they stay even if it is hidden. The "top" value only changes the vertical position, but the horizontal position is affected by the "left" value. Not assigning the "left" value is based on the assumption that the space is big enough to hide the popup menus and not affect other elements to display. But in the fact, the assumption is not always true, and the unneeded scroll bar always occurs because the element occupies the space even if it is hidden.
Change History (5)
comment:1 Changed 10 years ago by
Component: | General → Dijit |
---|---|
Description: | modified (diff) |
Milestone: | tbd → 1.8 |
Owner: | set to bill |
Summary: | issue when the pop up menu is hidden → hidden popup menu can cause scroll bar |
comment:2 Changed 9 years ago by
Milestone: | 1.8 → 2.0 |
---|
comment:4 Changed 8 years ago by
Milestone: | 2.0 → 1.9 |
---|---|
Status: | new → assigned |
Summary: | hidden popup menu can cause scroll bar → dijit/popup::moveOffScreen() can cause horizontal scroll bar |
I doubt that hidden popups can cause a scroll bar, since we now hide popups with display:none. moveOffScreen() is just used momentarily to get the size of the popup before displaying it on the screen. But I suppose that there's an issue with moveOffScreen() where it should be setting left or right, and that could momentarily cause a horizontal scrollbar, if for some reason left or right was set on the widget's style. So I can add code to moveOffScreen() to set left or right.
comment:5 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in [30742], but typed the wrong ticket number in the comment.
Setting "left" is tricky because in RTL mode it can backfire. In that case you would need to set "right". Probably we used to set left, and removed it, or changed it to "50%", for that reason. Anyway, I'll take a look.