Skip to content

Commit

Permalink
fix(v-model): exclude range from lazy guard logic
Browse files Browse the repository at this point in the history
fix #5875
  • Loading branch information
yyx990803 committed May 12, 2022
1 parent ccf9256 commit 8c51c65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/runtime-dom/src/directives/vModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 8c51c65

Please sign in to comment.