logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: 6bea363b9db1c372e0e3add4458ff4c819b7c500
parent: 221db9f210b161851dd69bed87c49d0573d30e5f
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Thu,  4 Jul 2019 18:55:13 +0000

Merge branch 'fix-android-emoji-autocompletion' into 'develop'

Fix android emoji autocompletion

Closes #606

See merge request pleroma/pleroma-fe!869

Diffstat:

Msrc/components/emoji-input/emoji-input.js8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

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