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

オープン
#9,670 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

リンクされた react-admin-delayed-sync の再現から始め、react-hook-form 7.44.3 および 7.50.1 と動作を比較します。再現で示されている TextInput の初期化とイベント処理を追跡し、その後、Cypress での入力によってユーザー名の先頭文字が保持され、パスワードは正しいままであることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
TypeScript
スター
27k
フォーク
5.5k
平均マージ
1日 2時間
マージ済み PR(30日)
32

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

marmelab/react-admin のほかの issue

marmelab/react-admin の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。