Browse Source

activate new current tab

Mehmet Bektas 5 years ago
parent
commit
5b02edb823
1 changed files with 7 additions and 0 deletions
  1. 7 0
      packages/tabmanager-extension/src/index.ts

+ 7 - 0
packages/tabmanager-extension/src/index.ts

@@ -64,6 +64,13 @@ const plugin: JupyterFrontEndPlugin<void> = {
         labShell.layoutModified.connect(() => {
           populate();
         });
+
+        // when current tab changes, make sure it is activated
+        labShell.currentChanged.connect((sender, args) => {
+          if (args.newValue) {
+            shell.activateById(args.newValue.id);
+          }
+        });
       }
 
       // Populate the tab manager.