Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Form inputs do not display associated list of errors

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

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

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

評価

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

調査の方向性

リンクされた CodeSandbox で問題を再現し、まず src/dataProvider.tsx とカスタム useSubmit フックを確認してください。次に packages/ra-core/src/form/setSubmissionErrors.ts を調べ、issue で言及されているリグレッションテストを追加してください。1つのフィールドに対する複数の API エラーが、フランス語と英語のエラーを含めて表示されれば完了です。

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

説明

What you were expecting:

I would see two error texts below the input concerned by the error

What happened instead:

The input is actually red, showing there is an error, but not displaying the text provided by the API

Steps to reproduce:

  • Go to this sandbox: https://codesandbox.io/s/broken-voice-dd8zth
  • On the Tag page, try creating a tag (with french and english labels). Save.
  • You should see the french error displaying correctly on the field while the english errors are not displaying

Related code:

Sanbox https://codesandbox.io/s/broken-voice-dd8zth?file=/src/dataProvider.tsx
I created a custom useSubmit hook whose purpose is to display errors associated to the fields concerned by the error

Other information:

From my investigation, the bug comes from the way setSubmissionErrors sets the error.
I'll try creating a merge request and adding a test to handle lists of errors associated to a field

Environment

  • React-admin version: 4.4.3
  • Last version that did not exhibit the issue (if applicable): N/A
  • React version: 17
  • Browser: Google Chrome: Version 106.0.5249.119 (Build officiel) (x86_64)
  • Stack trace (in case of a JS error): N/A
主要言語
TypeScript
スター
27k
フォーク
5.5k
平均マージ
1日 3分
マージ済み PR(30日)
32

環境構築

はじめの一歩

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

marmelab/react-admin のほかの issue

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

似ている issue

TypeScript の issue をもっと見る

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

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