diff --git a/src/components/tabs.tsx b/src/components/tabs.tsx index 0b62146..a86cdf5 100644 --- a/src/components/tabs.tsx +++ b/src/components/tabs.tsx @@ -50,7 +50,7 @@ const _Tabs: ParentComponent<{ active: string | undefined, onClose?: CommandType const tabsContext = useTabs(); const resolved = children(() => props.children); - const tabs = createMemo(() => resolved.toArray().filter(c => c instanceof HTMLElement).map(({ id, dataset }, i) => ({ id, label: dataset.tabLabel, options: { closable: dataset.tabClosable } }))); + const tabs = createMemo(() => resolved.toArray().filter(c => c instanceof HTMLElement).map(({ id, dataset }, i) => ({ id, label: dataset.tabLabel ?? '', options: { closable: Boolean(dataset.tabClosable ?? 'false') } }))); createEffect(() => { tabsContext.activate(tabs().at(-1)?.id); @@ -67,9 +67,17 @@ const _Tabs: ParentComponent<{ active: string | undefined, onClose?: CommandType return