-
-
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
Form not marked as dirty if new value is empty object #4678
Comments
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: The problem is indeed in the Maybe I can try to come up with a PR to fix it. |
Fixes logaretm#4678 This fix has been co-authored by @SCBosch.
Did anyone have the chance to look at this issue yet? I submitted a PR (#4710) half a year ago, but I haven't heard anything yet. |
@evpaassen Checked your PR, sorry for the delay. I tested it and merged it just now. This will go out in the next patch, thank you all for reporting and fixing this. |
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: