]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(v-model): avoid clearing IME compose state on updates (#2304)
authorᴜɴвʏтᴇ <i@shangyes.net>
Thu, 8 Oct 2020 02:34:53 +0000 (10:34 +0800)
committerGitHub <noreply@github.com>
Thu, 8 Oct 2020 02:34:53 +0000 (22:34 -0400)
fix #2302

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

index c7dfa40c2058f14c814503df715747bcdc9eb4e6..90084eed20ae3b4c54d53cdf6704913b3abab329 100644 (file)
@@ -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