`TextInput` component not handling events during the initial life cycles

Abierto
#9,670 4 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Comienza con la reproducción vinculada de react-admin-delayed-sync y compara su comportamiento con react-hook-form 7.44.3 y 7.50.1. Rastrea la inicialización y el manejo de eventos de TextInput que se muestran en la reproducción y, a continuación, verifica que la escritura con Cypress conserve el carácter inicial del nombre de usuario mientras la contraseña siga siendo correcta.

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

Descripción

needs more info

Some bit of context

We use react-admin version 4.16.9 in a pnpm monorepo workspace. And we have the automatic renovate pull requests to update our repository packages.
Our end to end tests were successful before updating to react-hook-form from 7.44.3 to 7.51.0 then it started to fail consistently. The failing test was related to react-admin's logging in page.

Test is as follows (in this order):
  • Cypress finds the username and password fields.
  • Cypress starts typing in the corresponding credentials.

Assume the credentials are:

  • username: a-user
  • password: what-a-password

What you were expecting:
It was expected to fill in the username and password fields normally. But we noticed that the test was failing because the typed in username was -user (notice the missing a) but the password field was normal what-a-password.

What happened instead:
It was expected of course that the username and password to have a-user and what-a-password respectively.

Steps to reproduce:

You can check the reproduction code here react-admin-delayed-sync.

If you change react-hook-form to 7.44.3 then you will see the sync works as expected

Version 7.44.3

https://github.com/marmelab/react-admin/assets/29442110/9d568ab7-78d8-4035-9ae0-30105327c714

Version 7.50.1

https://github.com/marmelab/react-admin/assets/29442110/034ad9a0-8300-4d86-b81e-ab16013b9746

Thus, we can notice that the issue is with the TextInput component not from the registered input component with react-hook-form.

Related code:

You can check the sandbox that I have created for this react-admin-delayed-sync.

Environment

  • React-admin version: ^4.16.10
  • React version: 18.2.0
  • React Hook Form version: 7.50.1
  • Browser: Chrome
Lenguaje dominante
TypeScript
Estrellas
27k
Forks
5.5k
Merge medio
1 d 2 h
PR fusionados (30 d)
32

Preparar el entorno

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.

Más de marmelab/react-admin

Todos los issues de marmelab/react-admin

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.