diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index f92810219a49..cc53eed76c43 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -507,11 +507,11 @@ function activateNotebookTools( labShell.currentChanged.connect((sender, args) => { updateTools(); }); - } else { - tracker.currentChanged.connect((sender, args) => { - updateTools(); - }); } + // A notebook widget could be closed without a change to labShell.currentWidget + tracker.currentChanged.connect((sender, args) => { + updateTools(); + }); }); return notebookTools;