-
Notifications
You must be signed in to change notification settings - Fork 25.3k
[Android] [TextInput] selection property has no effect #22513
Copy link
Copy link
Closed
Labels
BugComponent: TextComponent: TextInputRelated to the TextInput component.Related to the TextInput component.Platform: AndroidAndroid applications.Android applications.Platform: LinuxBuilding on Linux.Building on Linux.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Activity
Metadata
Metadata
Assignees
Labels
BugComponent: TextComponent: TextInputRelated to the TextInput component.Related to the TextInput component.Platform: AndroidAndroid applications.Android applications.Platform: LinuxBuilding on Linux.Building on Linux.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Environment
Run
react-native infoin 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:
onSelectionChangeeventtextInputRef.current.setNativeProps({ selection: {} })oncomponentDidUpdateImage:
Reproducible Demo
https://snack.expo.io/HkvTKtEkN