[Android] [TextInput] selection property has no effect #22513
Labels
Bug
Component: Text
Component: TextInput
Related to the TextInput component.
Platform: Android
Android applications.
Platform: Linux
Building on Linux.
Stale
There has been a lack of activity on this issue and it may be closed soon.
Environment
Run
react-native info
in your terminal and paste its contents here.Description
So I have this TextInput component that's supposed to toggle between
secureTextEntry
, a common use case for showing/hiding password. The issue is that the text selection is reset to the start of the input and I can't find a way to set the cursor position to the end after toggling "show/hide password".In other words, setting the property
selection={{ start: number, end: number }}
on a TextInput element seems to do nothing.What's been attempted:
onSelectionChange
eventtextInputRef.current.setNativeProps({ selection: {} })
oncomponentDidUpdate
Image:
Reproducible Demo
https://snack.expo.io/HkvTKtEkN
The text was updated successfully, but these errors were encountered: