Angular 2 material design, setting minimum rows for startup textarea

Does anyone know how to set the minimum rows for attribute 2?

Here is my example:

<md-input-container class="input-field message"> <textarea md-input md-autosize minRows="3" placeholder="Message" name="message"></textarea> </md-input-container> 

Here are the sources: https://github.com/angular/material2/blob/master/src/lib/input/autosize.ts

I noticed that it has the input variable minRows , and setting [minRows]="3" still didn't help.

I'm stuck, please help.

update: I tried to replicate this problem on plunkr and failed. It seems my local CSS is somehow overriding the Angular style of the material.

+6
source share
1 answer

I had the same problem today and it works for me

 <md-input-container class="full-width"> <textarea mdInput mdTextareaAutosize minRows="6" placeholder="Beschrijving" id="description" formControlName="description"></textarea> </md-input-container> 

textarea starts with 6 lines and expands if necessary.

+7
source

Source: https://habr.com/ru/post/1014600/


All Articles