From 8e89509008b9cb62891c28c9dc2a732df07987e9 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:01:12 -0700 Subject: [PATCH] Fix notebook-renderers compile error (#179506) --- extensions/notebook-renderers/src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/notebook-renderers/src/index.ts b/extensions/notebook-renderers/src/index.ts index 9cc5a3c8f0629..973e65b3f9a09 100644 --- a/extensions/notebook-renderers/src/index.ts +++ b/extensions/notebook-renderers/src/index.ts @@ -218,7 +218,10 @@ function findScrolledHeight(scrollableElement: HTMLElement): number | undefined } function scrollingEnabled(output: OutputItem, options: RenderOptions) { - return output.metadata?.scrollable !== undefined ? output.metadata?.scrollable : options.outputScrolling; + const metadata = output.metadata; + return (typeof metadata === 'object' && metadata + && 'scrollable' in metadata && typeof metadata.scrollable === 'boolean') ? + metadata.scrollable : options.outputScrolling; } function renderStream(outputInfo: OutputItem, outputElement: HTMLElement, error: boolean, ctx: IRichRenderContext): IDisposable {