Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use text content as result for comments #5294

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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