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
juliusknorr committed Nov 17, 2023
1 parent b637c00 commit b2364bd
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 @@ -115,8 +115,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 b2364bd

Please sign in to comment.