diff --git a/package.json b/package.json index dc8b916..deca267 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jupyterlab_hide_code", - "version": "4.0.0", + "version": "4.1.1", "description": "A button in JupyterLab to run the code cells and then to hide the code cells.", "keywords": [ "jupyter", diff --git a/src/index.ts b/src/index.ts index 2371551..b999290 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,6 +47,13 @@ export class ButtonExtension if (!hidden) { return; } + // Let keys through when the event originates inside a cell's output + // area — ipywidgets and similar interactive outputs live there and + // may need keys for their own handlers. + const target = event.target as HTMLElement | null; + if (target && target.closest('.jp-OutputArea')) { + return; + } // Cell type: m, y, r, 1-6 // Add/remove/reorder: a, b, d (dd), x, v, z, Shift+M const blockedKeys = [