react / react/react-native

TextInput value cannot be manipulated via setNativeProps after user input on iOS

Offen
#47,266 3 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Component: TextInput Issue: Author Provided Repro Platform: iOS Type: New Architecture
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

Description

When an uncontrolled TextInput has had its value manipulated via setNativeProps, receives user input and is then manipulated again via setNativeProps, the displayed value does not change.

This looks to be a New Arch issue and the issue is not reproducible in 0.76.0 on the old architecture.

Steps to reproduce
  1. Install the application with yarn ios
  2. Press "Press me!"
  3. Note that the TextInput contains the text "bananas"
  4. Clear the input field
  5. Press "Press me!"
  6. Note that the input field remains empty
React Native Version

0.76.0

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx react-native info
System:
  OS: macOS 14.7
  CPU: (16) arm64 Apple M3 Max
  Memory: 2.53 GB / 48.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.4
    path: /opt/homebrew/Cellar/node@18/18.20.4_1/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.7.0
    path: /opt/homebrew/Cellar/node@18/18.20.4_1/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0-alpha.2
    wanted: 15.0.0-alpha.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.0
    wanted: 0.76.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
None
Reproducer

https://github.com/mhoran/new-arch-set-text-repro/

Screenshots and Videos

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Verwende das verlinkte Repository new-arch-set-text-repro und führe es mit yarn ios unter der gemeldeten React-Native-0.76.0-Konfiguration der New Architecture aus. Reproduziere die Abfolge, „bananas“ zu setzen, Benutzereingaben einzugeben, diese zu löschen und erneut auf die Schaltfläche zu drücken; abgeschlossen ist die Aufgabe, wenn das zweite native Update den angezeigten TextInput-Wert ändert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ios, javascript, react-native
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.