Opened 8 years ago

Closed 8 years ago

#12323 closed defect (wontfix)

Select: doesn't render well when width is set by a CSS class

Reported by: cranespud Owned by: nonken
Priority: high Milestone: tbd
Component: themes Version: 1.6.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

For a dijit.form.Select when the width is set by a class, the drop down arrow doesn't render correctly (it is not at the end as expected) but when the width is set using the 'style' attribute it does renders correctly. This happens using the claro theme; with tundra and soria thems the select simply don't resize as specified when using the class attribute.

OS: Slackware 13.1 Browser: Firefox 3.6.13 Dojo: 1.5 CDN

OS: Windows XP Browser: Firefox version: 3.6.2, Browser: IE version: 8.0.6001.18702 (with this one, the arrow is in the correct place but too wide) Browser: Safari 4.0.5 (531.22.7) Dojo: 1.5 CDN

Example:

.smallSelect {
width: 50px;
}

<select dojoType='dijit.form.Select' class='smallSelect'>
   <option val='1'>One</option>
   <option val='2'>Two</option>
</select>

<select dojoType='dijit.form.Select' style='width: 80px'>
   <option val='1'>One</option>
   <option val='2'>Two</option>
</select>

Keep on with the great work!!

Attachments (1)

SelectClass.html (1.4 KB) - added by bill 8 years ago.
working test case, put in dijit/tests/form/

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by cranespud

sorry, its easier to appreciate the error when using large sizes for example .smallSelect { width: 150px; }

comment:2 Changed 8 years ago by bill

Description: modified (diff)
Summary: dijit.form.Select doesn't render well when width is set by a CSS classSelect: doesn't render well when width is set by a CSS class

You need to add the dijitSelectFixedWidth class to your Select; then it will work. It's added automatically when you specify a style attribute including a width setting, but that's not feasible for adding a class attribute.

BTW, please attach test cases to all tickets using the "attach file" button. I'll attach a test case showing it working.

comment:3 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

Changed 8 years ago by bill

Attachment: SelectClass.html added

working test case, put in dijit/tests/form/

Note: See TracTickets for help on using tickets.