Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

css - How to customize ion text area in ionic?

I would like ask for some assistance regarding on how to use ion-textarea. I am new in Ionic and experiencing a lot of new things in using this. Please refer to the image below on how I will fix this issue. Instead of showing scrollbar in the right side. The text was shown outside the text area. Hope you can help me. Thank you

enter image description here

Here's my code I used:

<ion-col size-md = "12">
    <ion-textarea class = "italic" rows="10" cols="5" maxlength = "200" placeholder="Please provide additional comments here..."  [(ngModel)]="postFeedback.explanation"></ion-textarea>
 </ion-col>
question from:https://stackoverflow.com/questions/65917457/how-to-customize-ion-text-area-in-ionic

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Please refer to Ionic documentation for this or any future questions regarding the natural behavior of ionic. To answer your question: try using autoGrow = "true" as follows :

<ion-col size-md = "12">
    <ion-textarea class = "italic" rows="10" cols="5" autoGrow="true" maxlength = "200" placeholder="Please provide additional comments here..."  [(ngModel)]="postFeedback.explanation"></ion-textarea>
 </ion-col>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...