#101 - insert emoji from emoji selector
This commit is contained in:
parent
f9071dac25
commit
3172b4e7c1
4 changed files with 30 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue