Skip to content

Commit 7d57296

Browse files
authored
Merge pull request microsoft#183265 from microsoft/aamunger/outputStreaming
replace the content of the scrollable div, rather than the div itself
2 parents 8fb20be + 6ddfc5f commit 7d57296

File tree

1 file changed

+6
-1
lines changed
  • extensions/notebook-renderers/src

1 file changed

+6
-1
lines changed

extensions/notebook-renderers/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ function scrollingEnabled(output: OutputItem, options: RenderOptions) {
265265
metadata.scrollable : options.outputScrolling;
266266
}
267267

268+
// div.cell_container
269+
// div.output_container
270+
// div.output.output-stream <-- outputElement parameter
271+
// div.scrollable? tabindex="0" <-- contentParent
272+
// div output-item-id="{guid}" <-- content from outputItem parameter
268273
function renderStream(outputInfo: OutputItem, outputElement: HTMLElement, error: boolean, ctx: IRichRenderContext): IDisposable {
269274
const disposableStore = createDisposableStore();
270275
const outputScrolling = scrollingEnabled(outputInfo, ctx.settings);
@@ -281,7 +286,7 @@ function renderStream(outputInfo: OutputItem, outputElement: HTMLElement, error:
281286
const scrollTop = outputScrolling ? findScrolledHeight(outputElement) : undefined;
282287

283288
// If the previous output item for the same cell was also a stream, append this output to the previous
284-
const existingContentParent = getPreviousMatchingContentGroup(outputElement);
289+
const existingContentParent = getPreviousMatchingContentGroup(outputElement) || outputElement.querySelector('div');
285290
if (existingContentParent) {
286291
const existing = existingContentParent.querySelector(`[output-item-id="${outputInfo.id}"]`) as HTMLElement | null;
287292
if (existing) {

0 commit comments

Comments
 (0)