Replies: 2 comments 1 reply
-
Sorry to ask again but is there any way to get to the fields on the form. If I could somehow access "fieldsByPath" it would help me a lot. |
Beta Was this translation helpful? Give feedback.
-
I am back again :-) What I'm missing here is a separate meta-state/dirty flag for the controlledValues, but that's no longer important to me at the moment. But I discovered another weird behavior regarding the dirty-flag.
The problem is that the "currentValue" object in the check in "isSame" is not a user class but the value in
If I bypass this check, everything works as intended. If this check is performed, then I think the object in form.values should be of the same type as in the initialValues or the check should not be performed. But maybe I'm missing something? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a form where all the fields are not dirty (At least according to the vee-validate dev-tools), but the form itself is.
I think this is because the intialValues of the form are different from the currentValues. This is because there are some values that are not handled by vee-validate or are not active (Some fields are shown and hidden depending on the value of another field).
Unfortunately there is currently no way to get to all the "active" fields from vee-validate to check the dirty state there. Any idea how I could accomplish this without having to define and go through all the fields per form?
Also, wouldn't it make the most sense to determine the dirty state of the form at the "active" fields?
Additinal Info:
We use Symfony with API Platform as the backend. If there is a NULL value here, it is not transmitted and therefore not set in the initial values.
But because the form fields are present and get the initial value "undefined", this is also recognized as a "change" and the form is set to dirty.
Beta Was this translation helpful? Give feedback.
All reactions