Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#11138 closed defect (duplicate)

[regression] TextBox: class property no longer applied to the input element

Reported by: ben hockey Owned by: Douglas Hays
Priority: high Milestone: 1.5
Component: Dijit - Form Version: 1.5.0b2
Keywords: Cc:
Blocked By: Blocking:


previously since TextBox? was just a single input element, the class attribute was applied to the domNode (which was the input). now the class attribute is still applied to the domNode but it is no longer the input element.

i can agree with the argument that there's no regression since it is still consistently applying the class to the domNode, but on the other hand, the styling is not the same because it's no longer being applied to the same element.

of course, the workaround is not difficult, any selector which was previously .customClass now becomes .customClass .dijitInputInner

it makes sense that the class attribute needs to be applied to the domNode so that you can use the class to select any of the nodes inside a widget. maybe just add a note to the release notes to point this out as a potential migration issue.

Change History (5)

comment:1 Changed 9 years ago by ben hockey

actually... the workaround is not as simple as i thought it would be. some styles still need to apply to the domNode while some need to be applied to the input but so far it's not a big deal.

however, i have found that it might be useful to add height: 100% to both .dijitInputInner and .dijitInputContainer to cause the input to inflate to the height of the domNode. i've only looked at this in firefox so i'm not sure if it's consistent across browsers but it causes the widget to be sized by sizing the domNode. also, i've only looked at TextBox? - not sure if these css classes are in other widgets and how they will be affected.

comment:2 Changed 9 years ago by ben hockey

and also maybe... add text-align: inherit to .dijitInputInner so that it can inherit the text-align from the domNode.

none of these are essential - i can work around all of them but just thought they might be considered useful for a large number of cases.

comment:3 Changed 9 years ago by bill

Milestone: tbd1.5
Owner: set to Douglas Hays

See also #11133. I agree, at the least definitely needs some documentation in the release notes.

comment:4 Changed 9 years ago by Douglas Hays

Resolution: duplicate
Status: newclosed

text-blah: inherit doesn't work in IE6. I'm closing this as a dup of #11133 so the discussion can be confined to 1 ticket.

comment:5 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.