From fbd198fbfe2f87c3c15a63d9770d00bf3fc9c142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=9C=C9=B4=D0=B2=CA=8F=D1=82=E1=B4=87?= Date: Thu, 8 Oct 2020 10:34:53 +0800 Subject: [PATCH] fix(v-model): avoid clearing IME compose state on updates (#2304) fix #2302 --- packages/runtime-dom/src/directives/vModel.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/runtime-dom/src/directives/vModel.ts b/packages/runtime-dom/src/directives/vModel.ts index c7dfa40c..90084eed 100644 --- a/packages/runtime-dom/src/directives/vModel.ts +++ b/packages/runtime-dom/src/directives/vModel.ts @@ -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