In my Ionic 5 app when an ion-textarea with autoGrow="true" becomes long in height, it always scrolls to top on input, when the user's input exceeds screen height. This exact issue was reported here and the fix is said to be merged here.
My Ionic version is 6.16.1 and I am facing this issue. The issue can be checked here
by checking the links you shared, there is this answer that seems to work on your stackblitz : https://github.com/ionic-team/ionic-framework/pull/19776#issuecomment-549735550
In your html :
<ion-textarea auto-grow="true" (ionInput)="onTextInput($event)"> </ion-textarea>
In your .ts file :
onTextInput(event) { event.target.getInputElement().then((textArea: HTMLTextAreaElement) => { console.log(textArea.textLength + " : " + textArea.value); textArea.scroll({top: textArea.scrollHeight}); }); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With