浏览代码

activate new current tab only if there isn't an active one

Mehmet Bektas 5 年之前
父节点
当前提交
23e90b339f
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      packages/application-extension/src/index.tsx

+ 3 - 2
packages/application-extension/src/index.tsx

@@ -112,9 +112,10 @@ const main: JupyterFrontEndPlugin<void> = {
       app.commands.notifyCommandChanged();
     });
 
-    // when current tab changes, make sure it is activated
+    // when current tab changes, activate the new current tab
+    // if there isn't an active tab
     app.shell.currentChanged.connect((sender, args) => {
-      if (args.newValue) {
+      if (!app.shell.activeWidget && args.newValue) {
         app.shell.activateById(args.newValue.id);
       }
     });