Custom Field Meta does not updated until input touched after 1.26.0
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
使用 package.json、src/simple-form.tsx 和 src/App.tsx 中所列的文件运行 StackBlitz 复现。比较 TanStack Form 1.26.0 与 1.27.7,跟踪 onMount 的 meta 更新以及 firstName 的渲染行为。完成的标准是 firstName 初始时隐藏,并且在不触碰 firstName 的情况下更改 color 时能够正确更新。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
I am using custom field meta's heavily, for example style={{ display: field.state.meta?.hidden ? 'none' : 'block' }}, for every field I have set of these meta's like dataSource, hidden, disabled, and others...
in example there is two field firstName and color, I have listener.onMount that hide firstName (through field.setMeta()) if color is "red", in v1.26.0 and before it works well, after this version it does not hide until I touch the field firstName
example use v1.26.0, change package version to see the problem
Your minimal, reproducible example
Steps to reproduce
- notice in example field
firstNameis hidden by default (it is hidden inonMount) - change the
colorto"green"fieldfirstNamewill appear - upgrade tanstack-form version to newer version
- after refresh you will notice
firstNamenow is not hidden - touch the field
firstNamenow it will hide
Expected behavior
compare by previous steps I exp expect:
- notice in example field
firstNameis hidden by default (it is hidden inonMount) - change the
colorto"green"fieldfirstNamewill appear - upgrade tanstack-form version to newer version
- field
firstNameshould still hidden by default
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: [linux, windows]
- Browsers: [chrome, vivaldi]
TanStack Form adapter
react-form
TanStack Form version
1.27.7
TypeScript version
5.9.3
Additional context
No response
- 主要语言
- TypeScript
- 星标
- 6.8k
- 派生
- 705
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/form 的其他 Issue
-
`isDefaultValue` is wrong when a field-level `defaultValue` is `null`可能已有人在做 @fenet-as 于 21 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Async validator doesn't re-trigger `isValidating` after first failed validation可能已有人在做 @drewsephski 于 26 天前认领。 未关闭
难度 2/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
-
[v2 alpha] devtools are always light mode可能已有人在做 @dikshit-n 于 60 天前认领。 未关闭area: runtime scope: devtools type: bug v2
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
FormGroupApi.getRelatedFields and FieldApi.validate() use unguarded startsWith for group membership, matching unrelated fields with a shared name prefix可能已有人在做 @HDPark95 于 79 天前认领。 未关闭area: runtime scope: core type: bug v1
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
FormApi: onSubmit/onServer error cleared on any non-matching validation cause, not just 'change'可能重新可做 关联的 PR 已关闭且未合并。 未关闭v1 v2: needs investigation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
needs-area
难度 2/5 1-3 小时 新手友好度 68/100
Azure/typespec-azure#5936 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 72/100
vercel-labs/scriptc#2910 ·
维护者通常 1 天内回复
-
automation missing-model model-sync provider:fireworks-ai
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/models.dev#12458 ·
维护者通常 1 天内回复