浏览代码

Fix command mode changing

Steven Silvester 8 年之前
父节点
当前提交
7f3da51b1a
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/notebook/notebook/widget.ts

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

@@ -621,6 +621,10 @@ class Notebook extends StaticNotebook {
       if (activeCell instanceof MarkdownCellWidget) {
         activeCell.rendered = false;
       }
+    } else {
+      if (this.node.contains(document.activeElement)) {
+        this.node.focus();
+      }
     }
     this.stateChanged.emit({ name: 'mode', oldValue, newValue });
     this.update();