fix: Use text content as result for comments

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-11-17 08:59:43 +01:00
committed by backportbot-nextcloud[bot]
parent e9574f3fc4
commit 3d1e28442f

View File

@@ -114,8 +114,13 @@ export default {
submit() { submit() {
const content = this.validate(true) const content = this.validate(true)
if (content) { if (content) {
this.$emit('input', content) // We need the plain text representation for the input event as otherwise it will propagate back to the contenteditable
this.$emit('submit', content) // 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 /* All credits for this go to the talk app