Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filled TextInput sends an event with empty ev.nativeEvent.text after switching secureTextEntry from false to true #34337

Closed
ws-fegon opened this issue Aug 3, 2022 · 6 comments
Labels
Component: Switch Component: TextInput Related to the TextInput component. Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@ws-fegon
Copy link

ws-fegon commented Aug 3, 2022

Description

This is a common situation when you need to make an password input with show/hide functionality.
Found the bug on iOS simulator.
When you entered a few symblols on field then switched secureTextEntry to false and continue typing you lose the symbols entered before

I found an unexpected event with empty text appears after first changing after switching secureTextEntry from false to true
Screenshot 2022-08-03 at 11 32 09

Screen.Recording.2022-08-03.at.10.51.50.mov

It also reproducable on the sandbox on your official documentation (but only on iOS platform)

Version

0.69.3

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 12.5
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 76.31 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.7.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.15.0 - /usr/local/bin/npm
Watchman: 2022.07.04.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.4/13F17a - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: ^0.69.3 => 0.69.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Enter some symbols
  2. Click on "show" button
  3. Click on "hide" button
  4. Enter 1 more symbol.
  5. You can see that symbols entered on the 1st step disappeared

Snack, code example, screenshot, or link to a repository

https://snack.expo.dev/Xv_j_Aure (only iOS, can't reproduce on Web or Android)
Screenshot 2022-08-03 at 11 39 13

@AntoineDoubovetzky
Copy link
Contributor

It seems to be a native behavior (source).

We could optionally override this behavior with a prop, but I am not sure we want to add another prop to the TextInput component.

I'd be happy to work on this, but I'll wait for confirmation from a maintainer that this is a feature we actually want.

@AlgoRoots
Copy link

I am facing the same issue. any solution please?

@4yki
Copy link

4yki commented Dec 22, 2022

would be nice to have option as a prop for this behavior...

1 similar comment
@hendyyou
Copy link

would be nice to have option as a prop for this behavior...

Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 25, 2024
Copy link

github-actions bot commented Mar 5, 2024

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Switch Component: TextInput Related to the TextInput component. Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

6 participants