Does Angular Material have built in autosizing for textareas?
The answer is simple: it should be matTextareaAutosize
, not just matAutosize
: https://github.com/angular/material2/blob/master/src/material-examples/input-autosize-textarea/input-autosize-textarea-example.html
Caution! Apparently, this will be removed in version 7 and is currently deprecated https://material.angular.io/components/input/api#MatTextareaAutosize
PS: See also comment from @Simon_Weaver regarding the deprecation
For my work apply this to textarea
:
Angular 7
<textarea cdkTextareaAutosize #autosize="cdkTextareaAutosize"cdkAutosizeMinRows="1" cdkAutosizeMaxRows="5"> </textarea>
Verify the scroll, in case of not showing verify the CSS property 'overflow: auto'