autoscroll post form on typing + some minor improvements

This commit is contained in:
Henry Jameson 2019-09-23 22:12:25 +03:00
parent 7b4cb38734
commit 6f0257cd7d
3 changed files with 26 additions and 7 deletions

View file

@ -211,10 +211,12 @@ const EmojiInput = {
this.keepOpen = keepOpen
this.$emit('input', newValue)
const position = this.caret + (insertion + spaceAfter + spaceBefore).length
if (!keepOpen) {
this.input.elm.focus()
}
this.$nextTick(function () {
// Re-focus inputbox after clicking suggestion
this.input.elm.focus()
// Set selection right after the replacement instead of the very end
this.input.elm.setSelectionRange(position, position)
this.caret = position