Closed
Description
Describe the bug
When calling form.resetFieldValue()
on a nested field ('some.nested.field'
), it will not reset.
The reason because it doesn't acknowledge the nested field name as a field path, and instead treats it as the literal key in the form values. See this line in FormApi.ts
.
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-3nazz9pj?file=src%2FApp.tsx
Steps to reproduce
- Go to the repro
- Change the shallow field and try to reset it. This works.
- Change the nested fied and try to reset it. It won't work.
Expected behavior
As a user, I expect the field name to be translated into the nested field value as that's what the typing implies.
How often does this bug happen?
Every time
Screenshots or Videos
Here's the outcome of what's actually happening behind the scenes:
Platform
Any browser
TanStack Form adapter
None
TanStack Form version
v1.10.0
TypeScript version
v5.8.3
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels