Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

improvement: less scroll shift (#1635)

Akshay Agrawalc8f9dc8f1b15
diff --git a/frontend/src/components/editor/cell/code/cell-editor.tsx b/frontend/src/components/editor/cell/code/cell-editor.tsx
index eab96f7484..8132f690a1 100644
--- a/frontend/src/components/editor/cell/code/cell-editor.tsx
+++ b/frontend/src/components/editor/cell/code/cell-editor.tsx
@@ -306,7 +306,7 @@ const CellEditorInternal = ({
editorViewRef.current?.focus();
editorViewRef.current?.dom.scrollIntoView({
behavior: "smooth",
- block: "center",
+ block: "nearest",
});
});
}
diff --git a/frontend/src/core/cells/scrollCellIntoView.ts b/frontend/src/core/cells/scrollCellIntoView.ts
index d01fef54e6..3687ef8ea1 100644
--- a/frontend/src/core/cells/scrollCellIntoView.ts
+++ b/frontend/src/core/cells/scrollCellIntoView.ts
@@ -63,7 +63,7 @@ export function focusAndScrollCellIntoView({
element.scrollIntoView({
behavior: "smooth",
- block: "center",
+ block: "nearest",
});
}