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.

Fix shift-enter not focusing new cell at end (#5481)

Trevor Manz0148b35483d2
diff --git a/frontend/src/core/cells/cells.ts b/frontend/src/core/cells/cells.ts
index fda967a424..536bd3b390 100644
--- a/frontend/src/core/cells/cells.ts
+++ b/frontend/src/core/cells/cells.ts
@@ -886,8 +886,7 @@ const {
const isPastLastCell = nextCellIndex === column.length;
const isBeforeFirstCell = nextCellIndex === -1;
- // Create a new cell at the end; no need to update scrollKey,
- // because cell will be created with autoScrollIntoView
+ // Create a new cell at the end and set scrollKey to focus it
if (isPastLastCell && !noCreate) {
const newCellId = CellId.create();
return {
@@ -905,9 +904,8 @@ const {
...state.cellHandles,
[newCellId]: createRef(),
},
+ scrollKey: newCellId,
};
- // Create a new cell at the beginning; again, no need to update
- // scrollKey
}
if (isBeforeFirstCell && !noCreate) {
@@ -927,6 +925,7 @@ const {
...state.cellHandles,
[newCellId]: createRef(),
},
+ scrollKey: newCellId,
};
}