Ver Fonte

Merge pull request #7349 from mbektasbbg/fix_tab_close_activation_issue

Activate new current tab
Steven Silvester há 5 anos atrás
pai
commit
8d773bf136
1 ficheiros alterados com 8 adições e 0 exclusões
  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;