-
-
Notifications
You must be signed in to change notification settings - Fork 8.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
fix(runtime-dom): prevent unnecessary updates in v-model checkbox when value is unchanged #12146
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-sfc
@vue/compiler-dom
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
@vue/compat
vue
commit: |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
Potentially a fix for #8638. |
I think this fix may suffer from a similar problem to #8639: |
edison1105
added
ready to merge
The PR is ready to be merged.
scope: v-model
❗ p4-important
Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.
and removed
ready to merge
The PR is ready to be merged.
labels
Oct 11, 2024
edison1105
requested changes
Oct 11, 2024
jh-leong
force-pushed
the
fix/12144
branch
2 times, most recently
from
October 11, 2024 05:57
cd9d697
to
ab185e8
Compare
…n value is unchanged
edison1105
approved these changes
Oct 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
❗ p4-important
Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.
scope: v-model
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
close #12144
In the browser, the event order for an input click is
click
->change
.When the
click
event has side effects,vModelCheckbox
'sbeforeUpdate
hook updatesel.checked
based on the oldbinding
, causing it to reset incorrectly. Thechange
event then updates thebinding
with the wrong value, leading to the issue.This PR ensures
el.checked
is only updated when thebinding
changes, fixing a 3.5 regression and restoring 3.4 behavior.NOTE: This PR only addresses cases where the value is neither an array nor a set (issue #8638 is still unhandled).