# Ionic 4 ion-textarea autoGrow does not display properly with ngModel?

**URL:** <https://forum.ionicframework.com/t/ionic-4-ion-textarea-autogrow-does-not-display-properly-with-ngmodel/166471>\
**Category:** Ionic Framework\
**Created:** [June 17, 2019, 4:29pm UTC](https://forum.ionicframework.com/t/ionic-4-ion-textarea-autogrow-does-not-display-properly-with-ngmodel/166471 "2019-06-17T16:29:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirdas](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@sirdas](https://forum.ionicframework.com/u/sirdas)\
**Post date:** [June 17, 2019, 4:29pm UTC](https://forum.ionicframework.com/t/ionic-4-ion-textarea-autogrow-does-not-display-properly-with-ngmodel/166471/1 "2019-06-17T16:29:34Z")

</div>

Hello, when the ion-textarea is first displayed with text using ngModel, the autoGrow directive does not work as the height of the textarea (within ion-textarea) is initially set to 0px. As soon as I edit the text, the height is set automatically and works. Here’s my code:

```auto
<ion-textarea [(ngModel)]="note" placeholder="Write a note here..." autoGrow="true" autoFocus="true" maxlength="400"></ion-textarea>

```

Is there a way to get autogrow working with ngmodel when it first displays? Thanks

---

<div class="post-metadata">

**Author:** ![Unkn0wn0x](https://avatars.discourse-cdn.com/v4/letter/u/46a35a/32.png) [@Unkn0wn0x](https://forum.ionicframework.com/u/Unkn0wn0x)\
**Post date:** [December 17, 2019, 4:13pm UTC](https://forum.ionicframework.com/t/ionic-4-ion-textarea-autogrow-does-not-display-properly-with-ngmodel/166471/2 "2019-12-17T16:13:30Z")

</div>

If you bind the `[(ngModle)]` (I think) there is no value change event fired.

Take a look at the code for the `autoGrow` attribute here:

- [https://github.com/ionic-team/ionic/blob/cc8678ad58f7dddcaf89e5b06d1de1f53ae0e57d/core/src/components/textarea/textarea.tsx#L132](https://github.com/ionic-team/ionic/blob/cc8678ad58f7dddcaf89e5b06d1de1f53ae0e57d/core/src/components/textarea/textarea.tsx#L132)

You will see, that the styles are applied after changing the value, so the easiest way would be to programatically fire a change (`ionChange`) event for the input.

Another (hacky) way would be to take the code, which is responsible for the `autoGrow` feature and apply it by yourself:

- [https://github.com/ionic-team/ionic/blob/cc8678ad58f7dddcaf89e5b06d1de1f53ae0e57d/core/src/components/textarea/textarea.tsx#L197](https://github.com/ionic-team/ionic/blob/cc8678ad58f7dddcaf89e5b06d1de1f53ae0e57d/core/src/components/textarea/textarea.tsx#L197)

Hope it helps.

Cheers  
Unkn0wn0x

---

<div class="post-metadata">

**Author:** ![crmontiel](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/crmontiel/32/127900_2.png) [@crmontiel](https://forum.ionicframework.com/u/crmontiel)\
**Post date:** [December 17, 2019, 4:19pm UTC](https://forum.ionicframework.com/t/ionic-4-ion-textarea-autogrow-does-not-display-properly-with-ngmodel/166471/3 "2019-12-17T16:19:22Z")

</div>

Try This.  
Add  
rows=“6” cols=“10”  
And  
[ngModelOptions]="{standalone: true}"

```auto
<ion-textarea [(ngModel)]="note" [ngModelOptions]="{standalone: true}" placeholder="Write a note here..." autoGrow="true" autoFocus="true" maxlength="400" rows="6" cols="10"></ion-textarea>

```

---

<div class="post-metadata">

**Author:** ![janicklasM79](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@janicklasM79](https://forum.ionicframework.com/u/janicklasM79)\
**Post date:** [March 18, 2021, 12:18pm UTC](https://forum.ionicframework.com/t/ionic-4-ion-textarea-autogrow-does-not-display-properly-with-ngmodel/166471/4 "2021-03-18T12:18:45Z")

</div>

Same issue. What fixed the issue for me was checking whether there is any input:

```auto
<ion-textarea [(ngModel)]="note" [autoGrow]="!!note"></ion-textarea>

```

---

<div class="post-metadata">

**Author:** ![Bathla-Boy](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Bathla-Boy](https://forum.ionicframework.com/u/Bathla-Boy)\
**Post date:** [March 19, 2021, 7:35pm UTC](https://forum.ionicframework.com/t/ionic-4-ion-textarea-autogrow-does-not-display-properly-with-ngmodel/166471/5 "2021-03-19T19:35:16Z")

</div>

You can try something like this as well.

```auto
<ion-textarea #textAres rows="4" (ionFocus)="textAres.autoGrow=true" [(ngModel)]="value" ></ion-textarea>

```
