Where am I in text field?


#1

Is there a way to work out where the “cursor” is within a textfield?
eg. if someone wrote “Hello World” and then positioned the cursor just after the W, then I’d want a value of 7


#2

Yes, you can with some native code. Checkout the similar thread for iOS.

For android try getSelectionStart() on the nativeView,

https://developer.android.com/reference/android/text/Selection.html#getSelectionStart(java.lang.CharSequence)