We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, if a value is changed to an empty object ({}), the isEqual util automatically assumes nothing has changed.
{}
isEqual
vee-validate/packages/vee-validate/src/utils/assertions.ts
Lines 164 to 165 in cdf0a80
I think checking both objects and comparing their key counts would be a viable option to solving this without a noticable performance hit.
const form = useForm({ initialValues: { a: { exists: true, } } });
a
const [a] = form.defineField('a'); a.value = {};
form.meta.dirty
true
false
Vue.js 3.x and vee-validate 4.x
No response
https://stackblitz.com/edit/vee-validate-issue-template-p3dgzu?file=src%2FApp.vue,src%2Fmain.ts
The text was updated successfully, but these errors were encountered:
The isssue is not limited to empty objects. Actually, every single attribute combination may be missing without the form being marked as dirty. Take this example: https://stackblitz.com/edit/vee-validate-issue-template-i9yukh?file=src%2FApp.vue
The problem is indeed in the isEqual function in utils/assertions.ts. Since the change in 32537e1 (#4341), this method is not commutative anymore and I think that is a bug. This is demonstrated here: https://stackblitz.com/edit/vee-validate-issue-template-bsm92l?file=src%2FApp.vue
utils/assertions.ts
Maybe I can try to come up with a PR to fix it.
Sorry, something went wrong.
fix: mark form dirty when object keys are deleted
760c2dc
Fixes logaretm#4678
b83365b
Fixes logaretm#4678 This fix has been co-authored by @SCBosch.
Successfully merging a pull request may close this issue.
What happened?
Currently, if a value is changed to an empty object (
{}
), theisEqual
util automatically assumes nothing has changed.vee-validate/packages/vee-validate/src/utils/assertions.ts
Lines 164 to 165 in cdf0a80
I think checking both objects and comparing their key counts would be a viable option to solving this without a noticable performance hit.
Reproduction steps
a
form.meta.dirty
, this should betrue
, but it isfalse
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://stackblitz.com/edit/vee-validate-issue-template-p3dgzu?file=src%2FApp.vue,src%2Fmain.ts
Code of Conduct
The text was updated successfully, but these errors were encountered: