Fix scroll bug when moving between pages
This commit is contained in:
parent
311e8f0341
commit
96d945bc56
@ -598,11 +598,13 @@ export class Editor {
|
|||||||
if (pageState) {
|
if (pageState) {
|
||||||
// Restore state
|
// Restore state
|
||||||
// console.log("Restoring selection state", pageState);
|
// console.log("Restoring selection state", pageState);
|
||||||
|
editorView.scrollDOM.scrollTop = pageState!.scrollTop;
|
||||||
editorView.dispatch({
|
editorView.dispatch({
|
||||||
selection: pageState.selection,
|
selection: pageState.selection,
|
||||||
scrollIntoView: true,
|
scrollIntoView: true,
|
||||||
});
|
});
|
||||||
editorView.scrollDOM.scrollTop = pageState!.scrollTop;
|
} else {
|
||||||
|
editorView.scrollDOM.scrollTop = 0;
|
||||||
}
|
}
|
||||||
editorView.focus();
|
editorView.focus();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user