From: Evan You Date: Thu, 12 May 2022 10:39:17 +0000 (+0800) Subject: fix(v-model): exclude range from lazy guard logic X-Git-Tag: v3.2.34-beta.1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c51c6514f99b4c70183f4c1a0eaabd482f88d5b;p=thirdparty%2Fvuejs%2Fcore.git fix(v-model): exclude range from lazy guard logic fix #5875 --- diff --git a/packages/runtime-dom/src/directives/vModel.ts b/packages/runtime-dom/src/directives/vModel.ts index b3e10a2a1c..3d05e9fa47 100644 --- a/packages/runtime-dom/src/directives/vModel.ts +++ b/packages/runtime-dom/src/directives/vModel.ts @@ -18,7 +18,9 @@ import { type AssignerFn = (value: any) => void const getModelAssigner = (vnode: VNode): AssignerFn => { - const fn = vnode.props!['onUpdate:modelValue'] || (__COMPAT__ && vnode.props!['onModelCompat:input']) + const fn = + vnode.props!['onUpdate:modelValue'] || + (__COMPAT__ && vnode.props!['onModelCompat:input']) return isArray(fn) ? value => invokeArrayFns(fn, value) : fn } @@ -78,7 +80,7 @@ export const vModelText: ModelDirective< el._assign = getModelAssigner(vnode) // avoid clearing unresolved text. #2302 if ((el as any).composing) return - if (document.activeElement === el) { + if (document.activeElement === el && el.type !== 'range') { if (lazy) { return }