diff --git a/src/datascience-ui/interactive-common/cellOutput.tsx b/src/datascience-ui/interactive-common/cellOutput.tsx index 5f2ce349c01a..545867bc27ca 100644 --- a/src/datascience-ui/interactive-common/cellOutput.tsx +++ b/src/datascience-ui/interactive-common/cellOutput.tsx @@ -351,9 +351,9 @@ export class CellOutput extends React.Component { private renderOutput = (outputs: nbformat.IOutput[]): JSX.Element => { const buffer: JSX.Element[] = []; - const transformedList = outputs.map(this.transformOutput); + const transformedList = outputs.map(this.transformOutput.bind(this)); - transformedList.forEach(transformed => { + transformedList.forEach((transformed, index) => { let mimetype = transformed.mimeType; // If that worked, use the transform @@ -367,7 +367,7 @@ export class CellOutput extends React.Component { // If we are not theming plots then wrap them in a white span if (transformed.outputSpanClassName) { buffer.push( -
+
{transformed.extraButton} @@ -376,7 +376,7 @@ export class CellOutput extends React.Component { ); } else { buffer.push( -
+
{transformed.extraButton}
@@ -390,7 +390,7 @@ export class CellOutput extends React.Component { mimetype = 'unknown'; } const str: string = this.getUnknownMimeTypeFormatString().format(mimetype); - buffer.push(
{str}
); + buffer.push(
{str}
); } }); @@ -404,6 +404,6 @@ export class CellOutput extends React.Component { style.maxHeight = `${this.props.maxTextSize}px`; } - return
{buffer}
; + return
{buffer}
; } }