Skip to content

Commit 8c51c65

Browse files
committed
fix(v-model): exclude range from lazy guard logic
fix #5875
1 parent ccf9256 commit 8c51c65

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/runtime-dom/src/directives/vModel.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import {
1818
type AssignerFn = (value: any) => void
1919

2020
const getModelAssigner = (vnode: VNode): AssignerFn => {
21-
const fn = vnode.props!['onUpdate:modelValue'] || (__COMPAT__ && vnode.props!['onModelCompat:input'])
21+
const fn =
22+
vnode.props!['onUpdate:modelValue'] ||
23+
(__COMPAT__ && vnode.props!['onModelCompat:input'])
2224
return isArray(fn) ? value => invokeArrayFns(fn, value) : fn
2325
}
2426

@@ -78,7 +80,7 @@ export const vModelText: ModelDirective<
7880
el._assign = getModelAssigner(vnode)
7981
// avoid clearing unresolved text. #2302
8082
if ((el as any).composing) return
81-
if (document.activeElement === el) {
83+
if (document.activeElement === el && el.type !== 'range') {
8284
if (lazy) {
8385
return
8486
}

0 commit comments

Comments
 (0)