Unable to set <ion-textarea> height

hi, i cant seem to be able to set a default height for ion-textarea.

passed values this way from page A

async popupSchedule(schedule){
const modal = await this.modalCtrl.create({
component: EditSchedulePage,
componentProps: {
‘description’: schedule.data().description,
‘date’: schedule.data().date,
return await modal.present();

and on another page i received input like this

@Input() title : string;
@Input() descrption : string;
@Input() date : string;

and in html

the concern is on the textarea…i expected it would expand based on the length of texts in it.

how can i make that possible?

try setting the rows property

above the text is partially covered

thanks for replying i tried this already [attr.rows]=10
it works only when i press enter. i need the rows set without having to press enter

You don’t set height , rather you set rows attribute:


hi , thanks alot it works but not until i removed auto-grow=“true”
and also is there a limit for number of rows?

If anyone needs to fix this, the problem still persists in ionic 5.

in order to let this work you have set autogrow to false, and add

ngAfterViewInit() {
this.textArea.autoGrow = true;

in your component.
this.textArea points to “@ViewChild(‘myTextArea’) private textArea: IonTextarea;” and you have a #myTextArea on your textarea element.