Skip to content

Commit

Permalink
fix(v-model): avoid clearing IME compose state on updates (#2304)
Browse files Browse the repository at this point in the history
fix #2302
  • Loading branch information
unbyte authored Oct 8, 2020
1 parent 4d1ebb5 commit fbd198f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/runtime-dom/src/directives/vModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export const vModelText: ModelDirective<
},
beforeUpdate(el, { value, modifiers: { trim, number } }, vnode) {
el._assign = getModelAssigner(vnode)
// avoid clearing unresolved text. #2302
if ((el as any).composing) return
if (document.activeElement === el) {
if (trim && el.value.trim() === value) {
return
Expand Down

0 comments on commit fbd198f

Please sign in to comment.