Add onInput() function as listener for input events, remove unnecessary compositionupdate listener
This commit is contained in:
parent
8fcb9c42aa
commit
59dd7f1320
1 changed files with 2 additions and 8 deletions
|
@ -147,7 +147,7 @@ const EmojiInput = {
|
||||||
input.elm.addEventListener('keydown', this.onKeyDown)
|
input.elm.addEventListener('keydown', this.onKeyDown)
|
||||||
input.elm.addEventListener('click', this.onClickInput)
|
input.elm.addEventListener('click', this.onClickInput)
|
||||||
input.elm.addEventListener('transitionend', this.onTransition)
|
input.elm.addEventListener('transitionend', this.onTransition)
|
||||||
input.elm.addEventListener('compositionupdate', this.onCompositionUpdate)
|
input.elm.addEventListener('input', this.onInput)
|
||||||
},
|
},
|
||||||
unmounted () {
|
unmounted () {
|
||||||
const { input } = this
|
const { input } = this
|
||||||
|
@ -159,7 +159,7 @@ const EmojiInput = {
|
||||||
input.elm.removeEventListener('keydown', this.onKeyDown)
|
input.elm.removeEventListener('keydown', this.onKeyDown)
|
||||||
input.elm.removeEventListener('click', this.onClickInput)
|
input.elm.removeEventListener('click', this.onClickInput)
|
||||||
input.elm.removeEventListener('transitionend', this.onTransition)
|
input.elm.removeEventListener('transitionend', this.onTransition)
|
||||||
input.elm.removeEventListener('compositionupdate', this.onCompositionUpdate)
|
input.elm.removeEventListener('input', this.onInput)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -406,12 +406,6 @@ const EmojiInput = {
|
||||||
this.resize()
|
this.resize()
|
||||||
this.$emit('input', e.target.value)
|
this.$emit('input', e.target.value)
|
||||||
},
|
},
|
||||||
onCompositionUpdate (e) {
|
|
||||||
this.showPicker = false
|
|
||||||
this.setCaret(e)
|
|
||||||
this.resize()
|
|
||||||
this.$emit('input', e.target.value)
|
|
||||||
},
|
|
||||||
onClickInput (e) {
|
onClickInput (e) {
|
||||||
this.showPicker = false
|
this.showPicker = false
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue