Merge pull request #712 from StCyr/stcyr-fix708

Fixes Composer's weird behavior when hashtag or mention is last element in post
pull/732/head
Maxence Lange 2019-09-09 13:41:22 -01:00 zatwierdzone przez GitHub
commit 5f374f9b9e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -49,7 +49,8 @@
<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 +778,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) => {