[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 摘要。