react / react/react-native

(RN 79.5) TextInput onContentSizeChange is not triggered on iOS

Ouverte
#52,854 28 commentaires 15 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Component: TextInput Issue: Author Provided Repro Platform: iOS
Langage dominant
C++
Étoiles
127k
Forks
25.3k
Merge moyen
1 j 23 h
PR mergées (30 j)
4

Description

Description

I noticed that after updating to 0.79.5, TextInput.onContentSizeChange is no longer triggered even if the multiline is set to true and input does growth properly. It is only triggered once, when the component mounts.

Steps to reproduce
  1. Add any TextInput component with onContentSizeChange prop, eg. onContentSizeChange={() => Alert.alert('hello')}
  2. Render the app with iOS-simulator
  3. Press enter on input, nothing happens.
React Native Version

0.79.5

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M1
  Memory: 150.19 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.npm-global/bin/yarn
  npm:
    version: 10.8.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2025.04.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/lib/ruby/gems/3.0.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 22.0.1
    path: /usr/bin/javac
  Ruby:
    version: 3.4.2
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.5
    wanted: 0.79.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.80.2 is now available (your project is running on v0.79.5).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.80.2
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.79.5&to=0.80.2
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Stacktrace or Logs
None
MANDATORY Reproducer

https://snack.expo.dev/@njaah/textinput-issue?platform=ios

Screenshots and Videos

No response

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le reproducteur Snack obligatoire et le point d’entrée TextInput.onContentSizeChange sur le simulateur iOS, en utilisant React Native 0.79.5. Suivez le comportement iOS d’un champ de saisie multiligne lorsqu’il s’agrandit après avoir appuyé sur Enter ; le travail est terminé lorsque le callback est déclenché pour les changements ultérieurs de la taille du contenu, et pas seulement au montage.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
ios, react-native
Domaine
mobile
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.