浏览代码

Merge pull request #7349 from mbektasbbg/fix_tab_close_activation_issue

Activate new current tab
Steven Silvester 5 年之前
父节点
当前提交
8d773bf136
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      packages/application-extension/src/index.tsx

+ 8 - 0
packages/application-extension/src/index.tsx

@@ -112,6 +112,14 @@ const main: JupyterFrontEndPlugin<void> = {
       app.commands.notifyCommandChanged();
     });
 
+    // when current tab changes, activate the new current tab
+    // if there isn't an active tab
+    app.shell.currentChanged.connect((sender, args) => {
+      if (!app.shell.activeWidget && args.newValue) {
+        app.shell.activateById(args.newValue.id);
+      }
+    });
+
     // If the connection to the server is lost, handle it with the
     // connection lost handler.
     connectionLost = connectionLost || ConnectionLost;