react / react/react-native

TextInput onContentSizeChange triggers twice inside a Modal

Abierto
#47,186 8 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

0.76 Component: Modal Component: TextInput Issue: Author Provided Repro Newer Patch Available Type: New Architecture
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

Description

When using a TextInput inside a Modal, the onContentSizeChange callback is triggered twice instead of once. Outside the Modal the event triggers correctly (only once).

Steps to reproduce
  1. Install and launch the application
  2. Observe that onContentSizeChange triggers once (as expected)
  3. Click on the "Show modal" button
  4. Notice that onContentSizeChange for the TextInput inside the Modal triggers twice (unexpected behavior)
React Native Version

0.76.0

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info
System:
  OS: Windows 10 10.0.19045
  CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
  Memory: 9.86 GB / 31.84 GB
Binaries:
  Node:
    version: 20.12.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 9.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    Android NDK: 22.1.7171670
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-231.9392.1.2311.11330709
  Visual Studio: Not Found
Languages:
  Java: 17.0.8
  Ruby: Not Found
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-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
(NOBRIDGE) LOG  39.607845306396484
(NOBRIDGE) LOG  20.39215660095215
(NOBRIDGE) LOG  39.607845306396484
Reproducer

https://github.com/ilaloov/textinput-issue

Screenshots and Videos

No response

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con el reproductor enlazado y reproduce el TextInput dentro de un Modal en Android e iOS usando React Native 0.76.0. Sigue el evento onContentSizeChange desde los puntos de entrada de Modal/TextInput; se considera terminado cuando el callback se dispara una vez dentro del Modal, coincidiendo con el comportamiento fuera de él, con cobertura de regresión para ambas plataformas afectadas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react-native
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
28/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.