I am able to import MatTextareaAutosize from Angular Material, but I see nothing about it in the docs and have not found a way to use it.
I expected to use something like this:
<mat-form-field>
<textarea matInput matAutosize></textarea>
</mat-form-field>
Is there a way to get autosizing text boxes with angular material?
<mat-form-field> is a component used to wrap several Angular Material components and apply common Text field styles such as the underline, floating label, and hint messages.
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With