In Ionic v3 I did something like this to get cursor position: for iOS textArea._native.nativeElement.selectionStart
and for Android event.target.selectionStart
but it seems like I cannot find selectionStart on elementRef
.
I tried to access element using
@ViewChild('txArea', { read: ElementRef }) textArea: ElementRef;
and
<ion-textarea
#txArea
[(ngModel)]="description"
(keyup)="onKeyUp($event, txArea)"
rows="4"
autocorrect="on" autocomplete="on"
placeholder="Enter description (i.e. @JoeDoe, #forehand)">
</ion-textarea>
Can somebody help with this?
Thanks