Skip to content

Commit

Permalink
fix(VTextField): Update value on compositionend
Browse files Browse the repository at this point in the history
  • Loading branch information
k_kondou00 committed Apr 23, 2020
1 parent 4140af4 commit 07a40a2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/vuetify/src/components/VTextField/VTextField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export default baseMixins.extend<options>().extend({
input: this.onInput,
focus: this.onFocus,
keydown: this.onKeyDown,
compositionend: this.onCompositionEnd,
}),
ref: 'input',
})
Expand Down Expand Up @@ -443,6 +444,11 @@ export default baseMixins.extend<options>().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

Expand All @@ -457,9 +463,7 @@ export default baseMixins.extend<options>().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) {
Expand Down

0 comments on commit 07a40a2

Please sign in to comment.