Skip to content

Commit 7e5dbb6

Browse files
authored
Merge pull request #5297 from nextcloud/backport/5294/stable27
2 parents e9574f3 + 3d1e284 commit 7e5dbb6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/card/CommentForm.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,13 @@ export default {
114114
submit() {
115115
const content = this.validate(true)
116116
if (content) {
117-
this.$emit('input', content)
118-
this.$emit('submit', content)
117+
// We need the plain text representation for the input event as otherwise it will propagate back to the contenteditable
118+
// The input event is only used for change detection to make sure that the input is reset after posting the comment
119+
const temp = document.createElement('div')
120+
temp.innerHTML = content
121+
const text = temp.textContent || temp.innerText || ''
122+
this.$emit('input', text)
123+
this.$emit('submit', text)
119124
}
120125
},
121126
/* All credits for this go to the talk app

0 commit comments

Comments
 (0)