Opened 9 years ago
Closed 8 years ago
#15140 closed defect (fixed)
[patch] [cla] _HasDropDown miscalculates width of dropdown
Reported by: | Douglas Hays | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.9 |
Component: | Dijit | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Run test_Select.html on Chrome and open the "Test One" dropdown. You'll see whitespace to the right of every menu item. Close the dropdown and then reopen it. Now the whitespace is gone. _HasDropDown is changing overflowY AFTER calculating the width which changes the width for subsequent calculations.
Attachments (2)
Change History (10)
Changed 9 years ago by
Attachment: | 15140.patch added |
---|
comment:1 Changed 9 years ago by
Owner: | set to bill |
---|---|
Status: | new → assigned |
comment:2 Changed 8 years ago by
Priority: | undecided → high |
---|
comment:3 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|
comment:4 Changed 8 years ago by
Owner: | changed from bill to Douglas Hays |
---|---|
Status: | assigned → pending |
Summary: | _HasDropDown miscalculates width of dropdown → [patch] [cla] _HasDropDown miscalculates width of dropdown |
Hmm I'm not seeing it on http://download.dojotoolkit.org/release-1.8.0/dojo-release-1.8.0/dijit/tests/form/test_Select.html, are you? Testing on the latest chrome on mac.
I'm not sure if you are talking about space before or after the right border, but I'm not seeing either.
comment:5 Changed 8 years ago by
Status: | pending → open |
---|
This is recreating for me using the 1.8.0 link you provided, as well as on trunk, using both Chrome/Win7 and Chrome/OSX. The extra space is from the end of the option text to the right border. The option "Washington" is the longest and thus the right border should be just after the end of the text. But the first dropdown open shows whitespace after the text, and subsequent opens have no additional whitespace.
comment:6 Changed 8 years ago by
I reproduced it on chrome/win7, and your patch seems to fix it, although it seems like a chrome (or webkit) bug that you are working around.
For the test case you listed (first Select in test_Select.html), for some reason on Chrome, initially the drop down's offsetWidth is 89px, rather than 72px. Although the "developer tools" (chrome's built in debugging tools) correctly show the dropdown's metrics as 70px content box + 2px border, offsetWidth is strangely 89px. Then, due to an arguable bug, _HasDropDown calls dropDown.resize({w: 89}), which does this.menuTableNode.style.width = "100%", which has the side effect of curing the original mismeasurement.
comment:7 Changed 8 years ago by
Owner: | changed from Douglas Hays to bill |
---|---|
Status: | open → assigned |
The strange initial offsetWidth comes from some strange CSS setting overflowX and overflowY on the Select menu, starting in [21699] (my check in). It looks like your patch to _HasDropDown worked because it nullified that CSS setting, so I can fix the problem by just removing that CSS.
There's another problem when a vertical scrollbar causes a horizontal scrollbar to appear too, like the maxHeight=200 example in test_Select, so that requires another fix.
Anyway, I will check in a fix, please test it too to see if I broke something.
possible fix