mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
web: prevent scroll jump when toggling focus mode
This commit is contained in:
committed by
Abdullah Atta
parent
a747bafa69
commit
3b363a1b20
@@ -410,7 +410,10 @@ function Portal(props: PropsWithChildren<{ containerId?: string }>) {
|
||||
|
||||
function toIEditor(editor: Editor): IEditor {
|
||||
return {
|
||||
focus: () => editor.current?.commands.focus("start"),
|
||||
focus: ({ position, scrollIntoView } = {}) =>
|
||||
editor.current?.commands.focus(position, {
|
||||
scrollIntoView
|
||||
}),
|
||||
undo: () => editor.current?.commands.undo(),
|
||||
redo: () => editor.current?.commands.redo(),
|
||||
getMediaHashes: () => {
|
||||
|
||||
@@ -27,7 +27,10 @@ export type NoteStatistics = {
|
||||
};
|
||||
|
||||
export interface IEditor {
|
||||
focus: () => void;
|
||||
focus: (options?: {
|
||||
position?: "start" | "end";
|
||||
scrollIntoView?: boolean;
|
||||
}) => void;
|
||||
undo: () => void;
|
||||
redo: () => void;
|
||||
getMediaHashes: () => string[];
|
||||
|
||||
Reference in New Issue
Block a user