Skip to content

Commit

Permalink
fix(v-model): should not trigger updates during input composition (#1183
Browse files Browse the repository at this point in the history
)
  • Loading branch information
underfin authored May 18, 2020
1 parent 520cad7 commit 83b7158
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/runtime-dom/src/directives/vModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export const vModelText: ModelDirective<
el.value = value
el._assign = getModelAssigner(vnode)
const castToNumber = number || el.type === 'number'
addEventListener(el, lazy ? 'change' : 'input', () => {
addEventListener(el, lazy ? 'change' : 'input', e => {
if ((e.target as any).composing) return
let domValue: string | number = el.value
if (trim) {
domValue = domValue.trim()
Expand Down

0 comments on commit 83b7158

Please sign in to comment.