Skip to content

Commit

Permalink
fix(overlay): ensure undefined data is not passed into theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Jun 2, 2020
1 parent 348ab3d commit 3e2e1ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/overlay/src/active-overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
property,
PropertyValues,
} from 'lit-element';
import { ifDefined } from 'lit-html/directives/if-defined';
import styles from './active-overlay.css.js';

export interface PositionResult {
Expand Down Expand Up @@ -401,10 +402,9 @@ export class ActiveOverlay extends LitElement {
}

public renderTheme(content: TemplateResult): TemplateResult {
const color = this.color as Color;
const scale = this.scale as Scale;
const { color, scale } = this;
return html`
<sp-theme .color=${color} .scale=${scale}>
<sp-theme color=${ifDefined(color)} scale=${ifDefined(scale)}>
${content}
</sp-theme>
`;
Expand Down

0 comments on commit 3e2e1ca

Please sign in to comment.