소스 검색

Add a comment

Steven Silvester 9 년 전
부모
커밋
3aeb9f3d2f
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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;
   }