diff --git a/webapp/IronCalc/src/components/Editor/Editor.tsx b/webapp/IronCalc/src/components/Editor/Editor.tsx index 0b332b6..7be2eb3 100644 --- a/webapp/IronCalc/src/components/Editor/Editor.tsx +++ b/webapp/IronCalc/src/components/Editor/Editor.tsx @@ -114,7 +114,7 @@ const Editor = (options: EditorOptions) => { } } if (type === cell.focus) { - textareaRef.current?.focus(); + textareaRef.current?.focus({ preventScroll: true }); } }); diff --git a/webapp/IronCalc/src/components/Workbook/Workbook.tsx b/webapp/IronCalc/src/components/Workbook/Workbook.tsx index 1b66927..bdd2bed 100644 --- a/webapp/IronCalc/src/components/Workbook/Workbook.tsx +++ b/webapp/IronCalc/src/components/Workbook/Workbook.tsx @@ -48,7 +48,7 @@ const Workbook = (props: { model: Model; workbookState: WorkbookState }) => { ); const focusWorkbook = useCallback(() => { if (rootRef.current) { - rootRef.current.focus(); + rootRef.current.focus({ preventScroll: true }); // HACK: We need to select something inside the root for onCopy to work const selection = window.getSelection(); if (selection) {