You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This option is a scourge (my fault) on TanStack Form and we're removing it (making it true default and renaming the property to opt-out, not opt-in behavior).
The fix for now is to:
Update to 0.24.0
Move all setFieldValues to {touch: true}
Closing, since we know about touch: true removal and are tracking here:
Describe the bug
The form resets to it's default state when using a HTML
<dialog>
element.You can force it to persist if you manually mark it
dirty
andisTouched
I'm not sure what else can cause the bug, surely it's not limited to a dialog
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/eloquent-farrell-rdqdnz?file=%2Fsrc%2FApp.js%3A52%2C39
Steps to reproduce
Click "Open Dialog"
To cause the issue, press "Set Data" and once you close the dialog, the inputs will clear.
The "Set Data Dirty" will persist, until the dialog is re-opened. Then the form resets again anyway
Expected behavior
I would expect the form default data to only be set on initial render
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
TanStack Form adapter
react-form
TanStack Form version
0.21.0
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: