From bb4a977f6677806ec8ab72779263787a2d2b3b81 Mon Sep 17 00:00:00 2001 From: k_kondou00 Date: Thu, 23 Apr 2020 13:11:57 +0900 Subject: [PATCH] fix(VTextField): Update value on compositionend See #5748 fixes #11190 --- .../vuetify/src/components/VTextField/VTextField.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/vuetify/src/components/VTextField/VTextField.ts b/packages/vuetify/src/components/VTextField/VTextField.ts index 1ca13127577..545bb5d0abf 100644 --- a/packages/vuetify/src/components/VTextField/VTextField.ts +++ b/packages/vuetify/src/components/VTextField/VTextField.ts @@ -401,6 +401,7 @@ export default baseMixins.extend().extend({ input: this.onInput, focus: this.onFocus, keydown: this.onKeyDown, + compositionend: this.onCompositionEnd, }), ref: 'input', }) @@ -443,6 +444,11 @@ export default baseMixins.extend().extend({ this.$refs.input.focus() }, + onCompositionEnd (e: Event) { + const target = e.target as HTMLInputElement + this.internalValue = target.value + this.badInput = target.validity && target.validity.badInput + }, onFocus (e?: Event) { if (!this.$refs.input) return @@ -457,9 +463,7 @@ export default baseMixins.extend().extend({ }, onInput (e: Event) { if (!(e as InputEvent).isComposing) { - const target = e.target as HTMLInputElement - this.internalValue = target.value - this.badInput = target.validity && target.validity.badInput + this.onCompositionEnd(e) } }, onKeyDown (e: KeyboardEvent) {