diff --git a/packages/runtime-dom/src/directives/vModel.ts b/packages/runtime-dom/src/directives/vModel.ts index 512f7686783..4ffa403f4ac 100644 --- a/packages/runtime-dom/src/directives/vModel.ts +++ b/packages/runtime-dom/src/directives/vModel.ts @@ -85,7 +85,10 @@ export const vModelText: ModelDirective< return } } - el.value = value == null ? '' : value + const newValue = value == null ? '' : value + if (el.value !== newValue) { + el.value = newValue + } } } diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index ebecc8972c6..1a50d612b50 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -28,7 +28,10 @@ export function patchDOMProp( // store value as _value as well since // non-string values will be stringified. el._value = value - el.value = value == null ? '' : value + const newValue = value == null ? '' : value + if (el.value !== newValue) { + el.value = newValue + } return } if (value === '' && typeof el[key] === 'boolean') {