react-native icon indicating copy to clipboard operation
react-native copied to clipboard

When using TextInput with secureTextEntry={true} on iOS, pressing the back button erases the entire text instead of just the last character.

Open S170209 opened this issue 1 year ago • 7 comments

Description

When using TextInput with secureTextEntry={true} on iOS, pressing the back button erases the entire text instead of just the last character.

Expected Behavior: The back button should erase only the last character of the input in the TextInput.

Current Behavior: The entire text is erased when pressing the back button once.

Steps to reproduce

  1. Enter text in a TextInput with secureTextEntry={true}.
  2. Focus out of the input (e.g., move to the next input field).
  3. Refocus on the TextInput.
  4. Press the back button to erase text.

React Native Version

0.72.5

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M2
  Memory: 49.34 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.16.0
    path: ~/.nvm/versions/node/v20.16.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.1
    path: ~/.nvm/versions/node/v20.16.0/bin/npm
  Watchman:
    version: 2024.08.05.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 3.1.4
    path: /Users/testUser/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.5
    wanted: 0.72.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: false
  newArchEnabled: false

Stacktrace or Logs

### Stacktrace or Logs


N/A

Reproducer

https://github.com/S170209/TextInputIssueRepro.git

Screenshots and Videos

https://github.com/user-attachments/assets/fcb30253-405d-48d2-9636-2c4b576e5b51

S170209 avatar Aug 22 '24 10:08 S170209

:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

react-native-bot avatar Aug 22 '24 10:08 react-native-bot

:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

react-native-bot avatar Aug 22 '24 10:08 react-native-bot

@S170209 Can you provide a reproducer using this template. It will be helpful for us.

shubhamguptadream11 avatar Aug 22 '24 11:08 shubhamguptadream11

Hello @S170209 could you provide reproduce code so it would be better

meetdhanani17 avatar Aug 24 '24 18:08 meetdhanani17

@S170209 Can you validate on newArch as well

deepanshushuklad11 avatar Aug 24 '24 19:08 deepanshushuklad11

This seems to be fixed here: https://github.com/facebook/react-native/pull/45964

shubhamguptadream11 avatar Aug 28 '24 10:08 shubhamguptadream11

@meetdhanani17 @deepanshushuklad11 care to check #45964 ? thanks!

angvp avatar Sep 05 '24 03:09 angvp

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.

react-native-bot avatar Mar 04 '25 05:03 react-native-bot

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

react-native-bot avatar Mar 11 '25 05:03 react-native-bot