You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Textarea's maxRows defaults to 12, so an autoGrow textarea stops growing at 12 rows unless the consumer raises the limit.
Solution
Default isClearable to true on TextField, so a field with a value shows a
clear button. Pass isClearable={false} to opt out.
Textarea: make it clearable by default.
Stop omitting isClearable, showClearOnInteraction and onClear from TextareaProps, and remove the hardcoded isClearable={false}.
Pass isClearable={false} to opt out.
Textarea maxRows: remove the default value.
When maxRows isn't set, autoGrow has no row limit. maxHeight still caps
the height if it's set.
When maxRows is set, nothing changes.
Read-only: hide the clear button when the input is read-only through input.readOnly too. showClearButton only checks the readOnly prop, while
the input renders readOnly={readOnly || input?.readOnly}.
Table column filters get a clear button with the new default. Clearing
calls onChange(''), so the filter resets. Add a test that it does.
DateField, TimeField, DateTimeField and Search already default to clearable,
so they're unaffected.
Update the TextField and Textarea stories and docs for the new defaults.
This is a breaking change:
Text fields and textareas that showed no clear button now show one once they
have a value.
autoGrow textareas without maxRows no longer stop at 12 rows.
Problem
TextField's
isClearabledefaults tofalse. Angular changed its equivalent,tedi-form-field'sclearable, to default totrue([FormField]: clearable set once on the form field, shared by DateField and TimeField angular#572).Textarea was previously excluded from clearing on purpose. That decision was recently changed: Textarea must now be clearable like the other form fields ([Textarea]: clearable by default, no default maxRows for autoGrow angular#751).
Textarea's
maxRowsdefaults to12, so anautoGrowtextarea stops growing at 12 rows unless the consumer raises the limit.Solution
isClearabletotrueonTextField, so a field with a value shows aclear button. Pass
isClearable={false}to opt out.isClearable,showClearOnInteractionandonClearfromTextareaProps, and remove the hardcodedisClearable={false}.isClearable={false}to opt out.maxRows: remove the default value.maxRowsisn't set,autoGrowhas no row limit.maxHeightstill capsthe height if it's set.
maxRowsis set, nothing changes.input.readOnlytoo.showClearButtononly checks thereadOnlyprop, whilethe input renders
readOnly={readOnly || input?.readOnly}.calls
onChange(''), so the filter resets. Add a test that it does.so they're unaffected.
This is a breaking change:
have a value.
autoGrowtextareas withoutmaxRowsno longer stop at 12 rows.