2 parents e9574f3 + 3d1e284 commit 7e5dbb6Copy full SHA for 7e5dbb6
1 file changed
src/components/card/CommentForm.vue
@@ -114,8 +114,13 @@ export default {
114
submit() {
115
const content = this.validate(true)
116
if (content) {
117
- this.$emit('input', content)
118
- 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
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)
124
}
125
},
126
/* All credits for this go to the talk app
0 commit comments