Skip to content
Snippets Groups Projects
Commit f86f4b51 authored by HJ's avatar HJ :fire:
Browse files

Support compositionupdate event to properly show autocomplete popup for IMEs and

android
parent 69eff651
No related branches found
No related tags found
2 merge requests!1028`master` refresh with `develop`,!869Fix android emoji autocompletion
Pipeline #14202 passed
......@@ -104,6 +104,7 @@ const EmojiInput = {
input.elm.addEventListener('keyup', this.onKeyUp)
input.elm.addEventListener('keydown', this.onKeyDown)
input.elm.addEventListener('transitionend', this.onTransition)
input.elm.addEventListener('compositionupdate', this.onCompositionUpdate)
},
unmounted () {
const { input } = this
......@@ -114,6 +115,7 @@ const EmojiInput = {
input.elm.removeEventListener('keyup', this.onKeyUp)
input.elm.removeEventListener('keydown', this.onKeyDown)
input.elm.removeEventListener('transitionend', this.onTransition)
input.elm.removeEventListener('compositionupdate', this.onCompositionUpdate)
}
},
methods: {
......@@ -216,6 +218,12 @@ const EmojiInput = {
}
},
onInput (e) {
this.setCaret(e)
this.$emit('input', e.target.value)
},
onCompositionUpdate (e) {
this.setCaret(e)
this.resize()
this.$emit('input', e.target.value)
},
setCaret ({ target: { selectionStart } }) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment