vee-validate icon indicating copy to clipboard operation
vee-validate copied to clipboard

The PR #4710 causes side effects

Open LionelVallet opened this issue 11 months ago • 2 comments

What happened?

Context I have a list of contacts and a contact form. When I select a contact, I reset a form with the selected contact values. An autosave is triggered by form meta change.

The contact schema contains some object array properties (e.g. addresses). When I reset the form (by selecting a contact) from a contact with addresses to a contact with no address, addresses key is deleted, form is marked dirty, it triggers the autosave. That is my first problem. From this point of view, its not a fix from a minor version update, it's a breaking change. Mark the form as dirty when you reset it twice with different values, where there is no user interaction with form inputs makes no sense.

Then there is a second problem. After this situation occurs (reset with an object containing an array with values and then an array without values), the adresses part of the form is completely broken. Changes on addresses field are not detected, i can push new ones, edit, etc. this no longer affects form meta. Whereas a modification to another field on the form works. I need to reload the page and select the contact with no addresses first to add a new address.

I need to stay in version 4.14.3 to avoid this behavior.

Reproduction steps

Use version 4.14.4 or higher (#4678) (#4710) Reset a form with an object containing an array with values and then with an object containing the same array without values.

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • [X] Firefox
  • [X] Chrome
  • [X] Safari
  • [X] Microsoft Edge

Relevant log output

No response

Demo link

https://stackblitz.com

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

LionelVallet avatar Nov 07 '24 16:11 LionelVallet