We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35785f3 commit cd9d697Copy full SHA for cd9d697
packages/runtime-dom/src/directives/vModel.ts
@@ -160,7 +160,7 @@ export const vModelCheckbox: ModelDirective<HTMLInputElement> = {
160
161
function setChecked(
162
el: HTMLInputElement,
163
- { value }: DirectiveBinding,
+ { value, oldValue }: DirectiveBinding,
164
vnode: VNode,
165
) {
166
// store the v-model value on the element so it can be accessed by the
@@ -173,7 +173,10 @@ function setChecked(
173
} else if (isSet(value)) {
174
checked = value.has(vnode.props!.value)
175
} else {
176
- checked = looseEqual(value, getCheckboxValue(el, true))
+ checked =
177
+ value === oldValue
178
+ ? el.checked
179
+ : looseEqual(value, getCheckboxValue(el, true))
180
}
181
182
// Only update if the checked state has changed
0 commit comments