#10145 closed bug (fixed)
Selectmenu: Incorrect size when original select has CSS width 100%
Reported by: | spjonez | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.11.1 |
Component: | ui.selectmenu | Version: | 1.11.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Select list does not use the correct size when placed in an inline-block container with a specific width and the original select is set to width 100%.
Fiddle: http://jsfiddle.net/Mwzhs/
Change History (5)
comment:2 Changed 9 years ago by
Status: | new → open |
---|---|
Summary: | Incorrect size when original select has CSS width 100% → Selectmenu: Incorrect size when original select has CSS width 100% |
This seems reasonable to me as calling .width()
and .outerWidth()
on the original <select>
element in this test case both return 300.
comment:4 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Selectmenu: Properly set width for button
Fixes #10145 Closes gh-1296
Changeset: 45e13ed208b3533e91d008789d61e5138501428a
comment:5 Changed 9 years ago by
Milestone: | none → 1.11.1 |
---|
Note: See
TracTickets for help on using
tickets.
To fix this bug make the following two changes:
Move lines 82/83 under this._setOption( "width", this.options.width ); currently the original element is hidden before the width is calculated so outerWidth reports an incorrect size.
In the original there is a slight difference in this code, the original set this.button.width and in 1.11 it sets outerWidth. I tested both versions and it's a few pixels off with outerWidth. It should be this:
if ( key === "width" ) {
}