-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial-values has issues with proxies, vee-validate should use toRaw on initial-values prop #4597
Closed
5 tasks done
Comments
lk77
changed the title
initial-values has issues with proxies
initial-values has issues with proxies, vee-validate should use toRaw on initial-values prop
Dec 14, 2023
The warning itself isn't dangerous, its meant to catch people doing deep changes to the model. The reactivity is unrelated here because data get cloned. I decided to remove the warning because it does not catch the specific case I want it to. |
Thanks ! |
This was referenced Jun 26, 2024
This was referenced Sep 12, 2024
This was referenced Sep 20, 2024
This was referenced Oct 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
Hello,
If a proxy object is passed to :initial-values, it cause issues with the
setInPath
function,this warning shows in the console, every time
setInPath
is used byFieldArray
insert
method for exampleReproduction steps
use options api, i don't know if this issue is present in composition api
1 / Add a Form
2 / Add a FieldArray with a Field inside
3 / Add your initial values in the data of the component
4 / pass initialValues to the Form
5 / See the warning in the console when calling insert method of FieldArray
6 / Use markRaw on the initialValue to see that it solves the warning
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
Demo link
github.com/lk77/test-vee-validate-bug
the only way to fix this issue is to use markRaw on the initial values like so :
Edit : for some reason, using markRaw on the initial values prevent the value to change when calling handleChange
Code of Conduct
The text was updated successfully, but these errors were encountered: