Fix notebook-renderers compile error (#179506)

This commit is contained in:
Raymond Zhao 2023-04-10 10:01:12 -07:00 committed by GitHub
parent 7f03ec6f7a
commit 8e89509008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {