[v2] Blurring the field with "change" trigger clears errors.

未關閉
#2,341 7 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
68/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
react, typescript
領域
frontend

研究方向

從連結的 StackBlitz 最小重現 src/rhf-revalidate.tsx 開始,透過提交表單、聚焦某個欄位,然後取消其焦點來重現問題。追蹤 React 表單適配器在僅設定 change 觸發器時如何處理驗證錯誤。完成的標準是,change 觸發器產生的錯誤在取消欄位焦點後仍然保留,且重現步驟不再將其清除。

由索引模型根據 Issue 內容生成。

描述

area: runtime scope: core type: undecided v2
Describe the bug

When a form has no blur validator blurring any input will clear errors from other triggers

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-form-fwx1qdqm?file=src%2Frhf-revalidate.tsx

Steps to reproduce
  1. Press submit
  2. Focus any field
  3. Blur the field & observe error dissapearing
Expected behavior

When I specify validator with only one trigger - "change", i want errors to persist blurring.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

every platform, not related to platform

TanStack Form adapter

react-form

TanStack Form version

2.0.0-alpha.1

TypeScript version

6.0.3

Additional context

No response

主要語言
TypeScript
星號
6.8k
分支
717
平均合併
5 天 22 小時
30 天內合併 PR
14

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TanStack/form 的其他 Issue

查看 TanStack/form 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。