[Feature Request]: A meta field which indicates a user-induced vs. program-induced value change #1522
-
I made a stackblitz form and experimented a lot and discovered a bug in my own application because I wrongly assumed that I was wrong, even setting the value like this will render the field dirty. I wanted to use the isDirty meta flag to be able to tell if it is a user-induced change or by my scripted logic. The only workarounds which I can use in the meantime would be to either use react states and track user input with them, or to manually overwrite the meta flags after I set them programmatically. https://stackblitz.com/edit/tanstack-form-elnvtbsp?file=src%2Findex.tsx Also, the documentation does not talk about this difference at all, it only claims that "user changes" are dirty. I would appreciate adding this fact to the documentation, that programmatic field value changes also render the field dirty. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
After reading this, one thing that immediately came to mind was an option flag you can use in
However, after testing it in your stackblitz, it doesn't actually appear to work properly. Maybe it's a bug? From the naming, it sounds like it should prevent the case you are experiencing. |
Beta Was this translation helpful? Give feedback.
It turns out you are on an outdated version. It doesn't work on
v1.3.3
, but it works as written above forv1.11.2
.