Compare commits
1 commit
develop
...
fix/revert
Author | SHA1 | Date | |
---|---|---|---|
|
2d5d7866f8 |
1 changed files with 13 additions and 19 deletions
|
@ -233,9 +233,7 @@ export default {
|
||||||
node
|
node
|
||||||
);
|
);
|
||||||
this.state = this.editorView.state.apply(tr);
|
this.state = this.editorView.state.apply(tr);
|
||||||
this.emitOnChange();
|
return this.emitOnChange();
|
||||||
|
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
insertCannedResponse(cannedItem) {
|
insertCannedResponse(cannedItem) {
|
||||||
|
@ -243,26 +241,22 @@ export default {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let from = this.range.from - 1;
|
const tr = this.editorView.state.tr.insertText(
|
||||||
let node = addMentionsToMarkdownParser(defaultMarkdownParser).parse(
|
cannedItem,
|
||||||
cannedItem
|
this.range.from,
|
||||||
|
this.range.to
|
||||||
);
|
);
|
||||||
|
|
||||||
if (node.childCount === 1) {
|
|
||||||
node = this.editorView.state.schema.text(cannedItem);
|
|
||||||
from = this.range.from;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tr = this.editorView.state.tr.replaceWith(
|
|
||||||
from,
|
|
||||||
this.range.to,
|
|
||||||
node
|
|
||||||
);
|
|
||||||
|
|
||||||
this.state = this.editorView.state.apply(tr);
|
this.state = this.editorView.state.apply(tr);
|
||||||
this.emitOnChange();
|
this.emitOnChange();
|
||||||
|
|
||||||
tr.scrollIntoView();
|
// Hacky fix for #5501
|
||||||
|
this.state = createState(
|
||||||
|
this.contentFromEditor,
|
||||||
|
this.placeholder,
|
||||||
|
this.plugins
|
||||||
|
);
|
||||||
|
this.editorView.updateState(this.state);
|
||||||
|
this.focusEditorInputField();
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue