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 loading a large form with 42 fields, I noticed that vee-validate performs multiple unnecessary validations:
On load: This is expected.
On model update: While this is debatable in my case but, it is acceptable.
Two additional validations afterward: These are not expected and cause issues within the Vue app.
This behavior results in the following error:
Uncaught (in promise) Maximum recursive updates exceeded in component <Form>. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook, or watcher source function.
Snippet of the Form
Clone the repository:
Copy the given repository to your local machine.
Install dependencies:
Run the following command to install all required dependencies:
npm install}
Start the development server:
npm run dev
Test the form validation:
Locate the form in the application.
Enter a number between 0 and 9 with up to 4 decimal places (e.g., 3.1234). The validation should pass.
Trigger validation errors:
Enter numbers less than 0, greater than 9, or with more than 4 decimal places (e.g., -1, 10, 3.12345).
Observe that the validation kicks in immediately.
What happened?
When loading a large form with 42 fields, I noticed that vee-validate performs multiple unnecessary validations:
This behavior results in the following error:
Below is an example of my form implementation:
Temporary Fix
When I modified the form to include
:initialValues="{}"
, the error disappeared:However, this feels more like a quick workaround rather than a proper solution.
Global Configuration Attempt
Before discovering the above workaround, I attempted to set global configuration for vee-validate in
my main.ts
file:I also tried adding
validateOnInput="false"
directly to the<Form>
tag, but this had no effect.My preferred solution would be to configure vee-validate explicitly for this form with the following settings:
Here are the versions of the libraries I am using:
Reproduction steps
Clone the repository:
Copy the given repository to your local machine.
Install dependencies:
Run the following command to install all required dependencies:
Start the development server:
Test the form validation:
Locate the form in the application.
Enter a number between 0 and 9 with up to 4 decimal places (e.g., 3.1234). The validation should pass.
Trigger validation errors:
Enter numbers less than 0, greater than 9, or with more than 4 decimal places (e.g., -1, 10, 3.12345).
Observe that the validation kicks in immediately.
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
https://github.com/Some-Random-D-e-v/Vee-validate-error/
Code of Conduct
The text was updated successfully, but these errors were encountered: