kopia lustrzana https://github.com/nextcloud/social
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
rodzic
d4c7b57905
commit
f85cfae459
|
@ -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) => {
|
||||
|
|
Ładowanie…
Reference in New Issue