Skip to content

Commit

Permalink
fix: Use text content as result for comments
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl authored and backportbot-nextcloud[bot] committed Nov 17, 2023
1 parent e9574f3 commit 3d1e284
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/card/CommentForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,13 @@ export default {
submit() {
const content = this.validate(true)
if (content) {
this.$emit('input', content)
this.$emit('submit', content)
// We need the plain text representation for the input event as otherwise it will propagate back to the contenteditable
// The input event is only used for change detection to make sure that the input is reset after posting the comment
const temp = document.createElement('div')
temp.innerHTML = content
const text = temp.textContent || temp.innerText || ''
this.$emit('input', text)
this.$emit('submit', text)
}
},
/* All credits for this go to the talk app
Expand Down

0 comments on commit 3d1e284

Please sign in to comment.