mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-03-26 17:19:54 +08:00
parent
980a684b14
commit
ff6c5aaecb
@ -445,8 +445,12 @@ export class Actions {
|
||||
selectionRange = selectionRange || this.#getSelectionRange();
|
||||
const newDoc = this.editor.cm.state.toText(text);
|
||||
const newSelectFrom = Math.min(selectionRange.from, newDoc.length);
|
||||
const scrollTop = this.editor.cm.scrollDOM.scrollTop;
|
||||
this.#dispatchChange(0, this.editor.cm.state.doc.length, text, newSelectFrom);
|
||||
this.focus();
|
||||
window.requestAnimationFrame(() => {
|
||||
this.editor.cm.scrollDOM.scrollTop = scrollTop;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user