Skip to content
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

The PR #4710 causes side effects #4929

Open
5 tasks done
LionelVallet opened this issue Nov 7, 2024 · 2 comments
Open
5 tasks done

The PR #4710 causes side effects #4929

LionelVallet opened this issue Nov 7, 2024 · 2 comments
Labels
🤔 needs reproduction This issue requires a demo

Comments

@LionelVallet
Copy link

LionelVallet commented Nov 7, 2024

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?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

No response

Demo link

https://stackblitz.com

Code of Conduct

@logaretm
Copy link
Owner

logaretm commented Nov 7, 2024

That is my first problem. From this point of view, its not a fix from a minor version update, it's a breaking change.

I understand, that happens often and happened to me with Vue itself many times. There is no way to tell if someone is relying on a bug or not so this can't be considered a breaking change.

Can you please create a minimal reproduction of both issues?

@logaretm logaretm added the 🤔 needs reproduction This issue requires a demo label Nov 7, 2024
@LionelVallet
Copy link
Author

LionelVallet commented Nov 8, 2024

I tried : https://stackblitz.com/edit/vitejs-vite-mfho5f?file=src%2Fcomponents%2FHelloWorld.vue&terminal=dev

But I can't reproduce and I can't tell the difference for now. In this example, I expected that selecting contact 2 and then contact 1 would mark the meta dirty, because the “addresses” key must be deleted, if I've understood correctly, since the array is empty.

I'm sorry I can't come up with a clear explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 needs reproduction This issue requires a demo
Projects
None yet
Development

No branches or pull requests

2 participants