From d56c5e63c38bcaefa9fd03124fd6dc62ed434c15 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Wed, 29 Dec 2021 18:45:37 +0100 Subject: [PATCH] Fix scroll toggle --- packages/notebook-extension/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) => {