diff --git a/src/next/cosmoz-tab.js b/src/next/cosmoz-tab.js index 9d1b29c..40840b7 100644 --- a/src/next/cosmoz-tab.js +++ b/src/next/cosmoz-tab.js @@ -1,4 +1,5 @@ -import { html, component, useLayoutEffect } from 'haunted'; +import { component, useLayoutEffect } from 'haunted'; +import { html, nothing } from 'lit-html'; import { ifDefined } from 'lit-html/directives/if-defined'; import computeScroll from 'compute-scroll-into-view'; @@ -37,7 +38,9 @@ const Tab = (host) => { - ${badge} + ${badge + ? html`${badge}` + : nothing} `; }; diff --git a/stories/cosmoz-tabs-next.stories.js b/stories/cosmoz-tabs-next.stories.js index f040ea2..7b31095 100644 --- a/stories/cosmoz-tabs-next.stories.js +++ b/stories/cosmoz-tabs-next.stories.js @@ -15,10 +15,7 @@ const basics = () => html` Tab4 ${Array(6) .fill() - .map( - (_, i) => - html`Tab ${5 + i}` - )} + .map((_, i) => html`Tab ${5 + i}`)} `;