diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index 052f579c1..4102a048d 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -245,10 +245,11 @@ const scrollOutput: JupyterFrontEndPlugin = { const height = node.getBoundingClientRect().height; const fontSize = parseFloat(node.style.fontSize.replace('px', '')); const lineHeight = (fontSize || 14) * 1.3; - const scroll = height > lineHeight * autoScrollThreshold; // do not set via cell.outputScrolled = true, as this would // otherwise synchronize the scrolled state to the notebook metadata - cell.toggleClass(SCROLLED_OUTPUTS_CLASS, scroll); + if (height > lineHeight * autoScrollThreshold) { + cell.toggleClass(SCROLLED_OUTPUTS_CLASS, true); + } }; tracker.widgetAdded.connect((sender, notebook) => {