diff --git a/packages/components/src/components/tabs/tabs.lite.tsx b/packages/components/src/components/tabs/tabs.lite.tsx index f88cd368782..8053c147587 100644 --- a/packages/components/src/components/tabs/tabs.lite.tsx +++ b/packages/components/src/components/tabs/tabs.lite.tsx @@ -122,15 +122,12 @@ export default function DBTabs(props: DBTabsProps) { ref.querySelectorAll('.db-tab-panel') ); for (const panel of tabPanels) { - (panel: Element, index: number) => { - if (!panel.id) { - panel.id = `${state._name}-tab-panel-${index}`; - panel.setAttribute( - 'aria-labelledby', - `${state._name}-tab-${index}` - ); - } - }; + if (panel.id) continue; + panel.id = `${state._name}-tab-panel-${index}`; + panel.setAttribute( + 'aria-labelledby', + `${state._name}-tab-${index}` + ); } } }