From f731002b7073059b237ef81f830d37df2633067d Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Thu, 3 Jun 2021 23:20:30 +0530 Subject: [PATCH] fix: Retain focus after sending message in rich content editor (#2372) Co-authored-by: Nithin David Thomas --- .../dashboard/components/widgets/WootWriter/Editor.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue b/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue index ff9ddfd67..ab4f5b5f1 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue @@ -136,9 +136,11 @@ export default { showCannedMenu(updatedValue) { this.$emit('toggle-canned-menu', !this.isPrivate && updatedValue); }, - value(newValue) { + value(newValue = '') { if (newValue !== this.lastValue) { - this.state = createState(newValue, this.placeholder, this.plugins); + const { tr } = this.state; + tr.insertText(newValue, 0, tr.doc.content.size); + this.state = this.view.state.apply(tr); this.view.updateState(this.state); } },