Ion-textarea autosize works on browser, doesn't work on android

I followed this tutorial https://competenepal.com/elastic-text-area-component-in-ionic-framework/
Here is a stackblitz I just made with it working https://stackblitz.com/edit/ionic-4emssa
I have the exact same thing in my ionic app that i’m deploying to my android phone and it’s not working, any ideas ?

Hey !

Personnaly I used this to autosize my <ion-textarea> elements:

It’s very easy to use and it works very well :wink:

1 Like

Lol no one ever pointed out this directive in any of the threads I’ve seen about this topic.

I’m not sure if I’m missing something but it’s isnt working for me

did npm install ngx-autosize in the root folder to install
in app.module.ts did import {AutosizeModule} from 'ngx-autosize';
in imports array added AutosizeModule

and then went on right away to use it in my html and isn’t working, neither on textarea nor on ion-textarea

just uninstalled and installed the package again

image

I get couple warnings but I don’t think any of em have anything to do with the autosize package, but with other packages I have

but still same result

The only difference I have with you is that I imported the module in my page.module.ts instead of app.module.ts.

Maybe try it to see if it’s better.
And about your warnings, I don’t have it on <ion-textarea> so… I don’t know :confused:

<ion-textarea
            rows="1"
            placeholder="Envoyer un message"
            maxlength="500"
            autocapitalize="on"
            autosize
            [(ngModel)]="newMessage"
            (ionFocus)="updateScroll()"
>
</ion-textarea>

I just have this and the import in my page module, but anything else actually :confused:
Hope you’ll get it working, cause this directive is really cool !

1 Like

DUuuuuudDEeee importing it into my page’s module totally fixed it and it’s working perfectly now

real mvp

1 Like

Nice, it’s a great directive, I don’t remember how I’ve found it but yeah I’ve searched for long too !

2 Likes