Closed cinderisles closed 1 year ago
Perhaps it is finally time to mark it as read only. But that's for 4.10
The reason is, vee-validate needs to know about the context of the mutation, or rather the intent. Is it a user input? Is it a reset? Is it initial value setting?
Without context provided by the various mutation methods like 'setFieldValue' or 'handleChange' or 'resetForm' then it would be hard to tell whether it should validate or not.
Thanks for bringing this up. I will mark it read only which would make warnings show up.
would it be possible to add an option for validateOnValueUpdate
like useField
's value
ref has?
Sadly no, because like I mentioned:
Is it a user input? Is it a reset? Is it the initial value setting?
This could be something to consider for v5 if we force error messages to be present at all times which would make this possible.
@logaretm this is not a minor change it breaks existing implementations.
I am getting an error when updating the Vue version to 3.4.5. Now my tests are broken and they say:
[Vue warn] Set operation on key "blablabla" failed: target is readonly.
I use ref in my component.
I was trying to figure out why mutating
values
here did not seem to run validationUntil I read the docs more closely on this page.
values
isIt would be nice if there was a warning message at runtime or if there was a more prominent place in the docs to put this warning.
just because I'm curious, is there a specific reason that validation does not run when
values
is mutated? I suppose as a workaround I couldwatch(values)
and manually trigger validation each time. or using the example above, I could do this