fix: Retain focus after sending message in rich content editor (#2372)

Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
This commit is contained in:
Pranav Raj S 2021-06-03 23:20:30 +05:30 committed by GitHub
parent b1228f805e
commit f731002b70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
},