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
When building complex forms with nested useVuelidate instances, it is expected that, without specific configs like $scope or $stopPropagation, the root instance automatically captured nested instances validations (by running nested form instances validators).
This assumption is broken if the root instance does not have $rewardEarly config and one of the child instances have.
Do note that if both parent and child have $rewardEarly: true the validations are captured as expected.
Go to the demo, click submit without touching the form
Notice that with the default configuration (both $rewardEarly: true) the validations from both root and nested forms are triggered
Now remove $rewardEarly: true configuration from the RootForm
Refresh the demo and click submit
Notice that only RootForm validators are triggered.
Expected behavior
Since neither $scope or $stopPropagation are use, it is expected that root form to capture validation results from child, independently of it has $rewardEarly: true or not as parent as nested form might be a reusable partial and parent shouldn't have any knowledge about it's validation mode configuration.
Additional context
We can workaround by manually calling v$.value.$commit() on the RootForm to ensure that validations are captured. But this should be automatic.
The text was updated successfully, but these errors were encountered:
renatodeleao
changed the title
root instance does not capture nested instances validation results if they have $rewardEarly: true
root instance does not capture nested instances validations results if they have $rewardEarly: trueFeb 28, 2024
renatodeleao
changed the title
root instance does not capture nested instances validations results if they have $rewardEarly: true
root instance does not capture nested instances validations results if they have $rewardEarly: true and root does not.
Feb 28, 2024
Describe the bug
When building complex forms with nested
useVuelidate
instances, it is expected that, without specific configs like $scope or $stopPropagation, the root instance automatically captured nested instances validations (by running nested form instances validators).This assumption is broken if the root instance does not have
$rewardEarly
config and one of the child instances have.Do note that if both parent and child have
$rewardEarly: true
the validations are captured as expected.Reproduction URL
Vuelidate 2 - Composition API + Vue 3
To Reproduce
Steps to reproduce the behavior:
$rewardEarly: true
) the validations from both root and nested forms are triggered$rewardEarly: true
configuration from theRootForm
RootForm
validators are triggered.Expected behavior
Since neither
$scope
or$stopPropagation
are use, it is expected that root form to capture validation results from child, independently of it has$rewardEarly: true
or not as parent as nested form might be a reusable partial and parent shouldn't have any knowledge about it's validation mode configuration.Additional context
We can workaround by manually calling
v$.value.$commit()
on the RootForm to ensure that validations are captured. But this should be automatic.The text was updated successfully, but these errors were encountered: