#101 - insert emoji from emoji selector

This commit is contained in:
jared 2019-03-29 15:56:50 -04:00
parent f9071dac25
commit 3172b4e7c1
4 changed files with 30 additions and 3 deletions

View file

@ -105,6 +105,11 @@ const EmojiInput = {
},
setCaret ({target: {selectionStart}}) {
this.caret = selectionStart
},
onEmoji (emoji) {
const newValue = this.value.substr(0, this.caret) + emoji + this.value.substr(this.caret)
this.$refs.input.focus()
this.$emit('input', newValue)
}
}
}