updates vue-contenteditable when vue-tribute replaces a mention or hashtag.

fixes https://github.com/nextcloud/social/issues/708

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
pull/712/head
Cyrille Bollu 2019-08-29 14:57:42 +02:00 zatwierdzone przez Maxence Lange
rodzic d4c7b57905
commit f85cfae459
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -49,7 +49,7 @@
<vue-tribute :options="tributeOptions">
<!-- eslint-disable-next-line vue/valid-v-model -->
<div ref="composerInput" v-contenteditable:post.dangerousHTML="canType && !loading" class="message"
placeholder="What would you like to share?" :class="{'icon-loading': loading}" @keyup.enter="keyup" />
placeholder="What would you like to share?" :class="{'icon-loading': loading}" @keyup.enter="keyup" @tribute-replaced="updatePostFromTribute" />
</vue-tribute>
<emoji-picker ref="emojiPicker" :search="search" class="emoji-picker-wrapper"
@emoji="insert">
@ -777,6 +777,10 @@ export default {
this.createPost(event)
}
},
updatePostFromTribute(event) {
// Trick to let vue-contenteditable know that tribute replaced a mention or hashtag
this.$refs.composerInput.oninput(event)
},
createPost(event) {
this.loading = true
this.$store.dispatch('post', this.getPostData()).then((response) => {