angular material textarea rows css not working
You need to add:
matAutosizeMinRows=5 matAutosizeMaxRows=20
This will set a minimum number of rows and the maximum number of rows which control the height also.
If you tried the above, as you edited the question, and you are getting a different results. Then probably another CSS overrides the textarea
height. Check with your developer tool to find out other CSS attached to the textarea
.
harkesh kumar
Hello.. I'm professional Full Stack Java developer, with highly effective problem solving abilities, and always enthusiast to learn,do new concepts in programming environment. Interested in Java, Spring, Rest API ,Angular and many others. Always trying to do something new, better than existing things, very inspired from Google.
Updated on June 04, 2022Comments
-
harkesh kumar almost 2 years
I am Using angular Material design and i used Textarea but the height is not change is fixed i tried so many ways but not working i like want
However, it is always the same size. Even Change css Also but its just changing height and i can say its not working
Any idea on how to change the size of the textarea?
<mat-form-field appearance="outline" class="example-full-width"> <mat-label>Discription</mat-label> <textarea matInput></textarea> </mat-form-field>
Even I Tried This But same issue am getting
<mat-form-field> <mat-label>Description</mat-label> <textarea matInput formControlName="description" matTextareaAutosize matAutosizeMinRows=1 matAutosizeMaxRows=5></textarea> </mat-form-field>
This Output i am getting form code
Expected Output
-
harkesh kumar over 5 yearsIf i try this also . --- <textarea matInput rows="5" cols="40" placeholder="text"></textarea>
-
-
Pramesh Bajracharya almost 4 yearsThe
StackBlitz
is not accessible anymore. Is it possible to update it someways please?