bug: Autogrow property in IonTextArea doesnt look good
See original GitHub issueBug Report
Ionic version:
[x] 5.1
Current behavior: When I initialize the value of a text area the label doesnt look good
Expected behavior: Need to auto expand if I set property autogrod = true
Steps to reproduce:
Set a value to textArea component
Related code:
<IonItem>
<IonLabel position="stacked">Beneficios</IonLabel>
<IonTextarea
className="inputs"
placeholder={benefits}
autoGrow={true}
maxlength={400}
value={benefits}
rows={6} cols={20}
onIonChange={e => setBenefits(e.detail.value!)}>
</IonTextarea>
</IonItem>
Other information:
Ionic info:
Ionic:
Ionic CLI : 6.8.0 (/Users/timugo/.nvm/versions/node/v12.16.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 5.1.0
Capacitor:
Capacitor CLI : 2.1.0
@capacitor/core : 2.1.0
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v12.16.0 (/Users/timugo/.nvm/versions/node/v12.16.0/bin/node)
npm : 6.14.4
OS : macOS Mojave
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:41 (20 by maintainers)
Top Results From Across the Web
Ionic 4 ion-textarea autoGrow does not display properly with ...
Hello, when the ion-textarea is first displayed with text using ngModel, the autoGrow directive does not work as the height of the textarea ......
Read more >The Cleanest Trick for Autogrowing Textareas
The trick is that you exactly replicate the content of the <textarea> in an element that can auto expand height, and match its...
Read more >HTMLTextAreaElement - Web APIs | MDN
Fires when the text selection in a <textarea> element has been changed. Examples. Autogrowing textarea example. Make a textarea autogrow while ...
Read more >Ionic 5 autoGrow BUG - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have tried this approach until this bug is solved and it seems to be working(I am using Ionic Vue):
state.loading is false initially.
You can decrease the timeout value but I think 250ms is acceptable.
Working Workaround
Until this is fixed, you can use this as a good Workaround:
define in global.scss:
Of course you can adjust the value, 66px fits perfect for my case 😊 Then you need to add this class to every textarea 😕