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
ValidationObserver scoped slot doesn't update dirty/pristine flag #2209
Comments
Seems to be caused by this code in
|
Or the problem is inside |
This is indeed introduced by #2185, |
|
Ok, thanks. But your change reopens #2185, and the bug with the ever-growing input listener list... |
This is inside the
Is it really necessary to add the listeners in each |
Each time the component re-renders, the render function gets a fresh VNode, so we need to add them in each render cycle, this is exactly the same thing as The "ever-growing" input listener list does not really occur in normal circumstances, I would need to figure out why the list is growing in the first place. As each render cycle should have new empty vnodes, so it shouldn't happen.
Normally the time required to render a component with a validation provider is almost the time required to render its children so certainly no problems there unless you can point out cases where it would be horrible. (I tested the providers in a 120+ input and no penalty was observed #1191). |
Ok, thanks for the explanation. I saw the growing handler list once in the debugger, but cannot reproduce it now with the new version 2.2.15. You're right that Vue always provides new empty vnodes to the render function; I cannot find a situation where Vue re-uses vnode instances. |
That's the problem. It shouldn't re-use them. My only guess is that maybe the rendering is slow enough to allow the render calls to overlap. |
…garetm/vee-validate * upstream/v2: (689 commits) fix: update v3 links and repo links closes logaretm#2467 chore: add v3 docs link docs: add note for read me Added missing changes flag in FieldFlags definition (logaretm#2218) docs: uneeded document about escaping regex docs: fix the regex example chore: bump to 2.2.15 revert: logaretm#2185 closes logaretm#2209 chore: bump to 2.2.14 chore: upgrade dependencies fix: mark vee-validate handlers so they get deduped Revert "fix: don't sync the value in an event handler closes logaretm#2185" chore: rm .DS_Store test: fix failing tests due to punctation test: fix failing tests Remove periods at end of validation messages (logaretm#2195) alpha_helper.js: regex for persian characters has been added (logaretm#2190) fix: don't sync the value in an event handler closes logaretm#2185 fix: cleanup events before adding new ones Update displaying-errors.md (logaretm#2186) ...
Versions
Describe the bug
Using ValidationObserver with a scoped slot to retrieve the current values of the flags
dirty
andpristine
:The flags
dirty
andpristine
are not updated, whereasvalid
andinvalid
are.See demo: https://codepen.io/dmoebius/pen/XvwLBb?editors=1010
Additional context
With vee-validate 2.2.3 is seems to work. You can verify this if you change the version in the Codepen demo. So the bug must have been introduced between 2.2.3 and 2.2.14.
The text was updated successfully, but these errors were encountered: