Steven Silvester 9 lat temu
rodzic
commit
3aeb9f3d2f
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      src/notebook/notebook/widget.ts

+ 2 - 0
src/notebook/notebook/widget.ts

@@ -796,6 +796,8 @@ class Notebook extends StaticNotebook {
    * Handle a new model.
    */
   protected onModelChanged(oldValue: INotebookModel, newValue: INotebookModel): void {
+    // Try to set the active cell index to 0.
+    // It will be set to `-1` if there is no new model or the model is empty.
     this.activeCellIndex = 0;
   }