Closed Windvis closed 12 months ago
Unlike the <input>
element, the <textarea>
doesn't support a value
attribute. <textarea value="something"></textarea>
would show an empty textarea in regular html files.
However, in Ember that does work since the Glimmer VM sets the property instead of the attribute.
In theory we could support these 2 variants:
<AuTextarea {{on "change" this.handleChange}}>{{this.value}}</AuTextarea>
<AuTextarea value={{this.value}} {{on "change" this.handleChange}} />
1 follows the regular html behavior, 2 follows the recommended path for the AuInput
component.
Supporting case 1 implicitly supports case 2 since we need ...attributes
in both cases and you can simply ignore the block. I would prefer to document a single variant though.
The gotcha with case 1 is that it is white space sensitive. <AuTextarea> something </AuTextarea>
will result in a value of " something "
.
It seems we're still using
Textarea
internally. We should give this the same treatment asAuInput
.