diff --git a/visual_console_client/src/VisualConsole.ts b/visual_console_client/src/VisualConsole.ts index e905746efb..ffaed36fcf 100644 --- a/visual_console_client/src/VisualConsole.ts +++ b/visual_console_client/src/VisualConsole.ts @@ -369,9 +369,10 @@ export default class VisualConsole { public render(prevProps: VisualConsoleProps | null = null): void { if (prevProps) { if (prevProps.backgroundURL !== this.props.backgroundURL) { - this.containerRef.style.backgroundImage = `url(${ - this.props.backgroundURL - })`; + this.containerRef.style.backgroundImage = + this.props.backgroundURL !== null + ? `url(${this.props.backgroundURL})` + : null; } if (prevProps.backgroundColor !== this.props.backgroundColor) { this.containerRef.style.backgroundColor = this.props.backgroundColor; @@ -380,9 +381,11 @@ export default class VisualConsole { this.resizeElement(this.props.width, this.props.height); } } else { - this.containerRef.style.backgroundImage = `url(${ - this.props.backgroundURL - })`; + this.containerRef.style.backgroundImage = + this.props.backgroundURL !== null + ? `url(${this.props.backgroundURL})` + : null; + this.containerRef.style.backgroundColor = this.props.backgroundColor; this.resizeElement(this.props.width, this.props.height); }