3

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

Tapas Mukherjee
  • 2,088
  • 1
  • 27
  • 66

1 Answers1

0

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}); }); }
Dharman
  • 30,962
  • 25
  • 85
  • 135
uKioops
  • 269
  • 3
  • 8