austin
austin

Reputation: 11

Ionic 3: Display text in multiple line

Thanks for reading my post.

I just started developing an app in Ionic 3 and there is an issue I ran into. I want to have a box to enter text into. When I use following code, I can enter both single line text as well as multiple line text.

<ion-item> <ion-label>Message</ion-label> <ion-textarea [(ngModel)]="_message" name="message"></ion-textarea> </ion-item>

But the issue is that the size of the box does not change. As I press Enter and type more words, the upper text hides because the view scrolls down. There is still space left in the view and I tried to adjust it, but couldn't.

Also, upon doing Google research, I did found a comment mentioning that this is a defect in Ionic Framework. But, I am not sure.

Thank You

Upvotes: 1

Views: 5675

Answers (1)

Ari
Ari

Reputation: 7556

It doesn't dynamically grow by itself. But you can increase the number of rows statically by adding rows.

<ion-textarea rows="5" [(ngModel)]="_message" name="message"></ion-textarea>

You can also try to modify its size dynamically yourself. Here is a sample code that does this.

Upvotes: 4

Related Questions