|
|
@ -105,6 +105,7 @@ const EmojiInput = {
|
|
|
|
input.elm.addEventListener('keyup', this.onKeyUp)
|
|
|
|
input.elm.addEventListener('keyup', this.onKeyUp)
|
|
|
|
input.elm.addEventListener('keydown', this.onKeyDown)
|
|
|
|
input.elm.addEventListener('keydown', this.onKeyDown)
|
|
|
|
input.elm.addEventListener('transitionend', this.onTransition)
|
|
|
|
input.elm.addEventListener('transitionend', this.onTransition)
|
|
|
|
|
|
|
|
input.elm.addEventListener('compositionupdate', this.onCompositionUpdate)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
unmounted () {
|
|
|
|
unmounted () {
|
|
|
|
const { input } = this
|
|
|
|
const { input } = this
|
|
|
@ -115,6 +116,7 @@ const EmojiInput = {
|
|
|
|
input.elm.removeEventListener('keyup', this.onKeyUp)
|
|
|
|
input.elm.removeEventListener('keyup', this.onKeyUp)
|
|
|
|
input.elm.removeEventListener('keydown', this.onKeyDown)
|
|
|
|
input.elm.removeEventListener('keydown', this.onKeyDown)
|
|
|
|
input.elm.removeEventListener('transitionend', this.onTransition)
|
|
|
|
input.elm.removeEventListener('transitionend', this.onTransition)
|
|
|
|
|
|
|
|
input.elm.removeEventListener('compositionupdate', this.onCompositionUpdate)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
@ -225,6 +227,12 @@ const EmojiInput = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onInput (e) {
|
|
|
|
onInput (e) {
|
|
|
|
|
|
|
|
this.setCaret(e)
|
|
|
|
|
|
|
|
this.$emit('input', e.target.value)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onCompositionUpdate (e) {
|
|
|
|
|
|
|
|
this.setCaret(e)
|
|
|
|
|
|
|
|
this.resize()
|
|
|
|
this.$emit('input', e.target.value)
|
|
|
|
this.$emit('input', e.target.value)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setCaret ({ target: { selectionStart } }) {
|
|
|
|
setCaret ({ target: { selectionStart } }) {
|
|
|
|