Skip to content

Commit

Permalink
fix: issue with tab name by changing the state._name once
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget committed Dec 18, 2024
1 parent 1a1e95e commit a1c1951
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/components/tabs/tabs.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function DBTabs(props: DBTabsProps) {

if (input && label) {
if (!input.id) {
const tabId = `tabs-${state._name}-tab-${index}`;
const tabId = `${state._name}-tab-${index}`;
label.setAttribute('for', tabId);
input.setAttribute(
'aria-controls',
Expand Down Expand Up @@ -128,7 +128,7 @@ export default function DBTabs(props: DBTabsProps) {
panel.id = `${state._name}-tab-panel-${index}`;
panel.setAttribute(
'aria-labelledby',
`tabs-${state._name}-tab-${index}`
`${state._name}-tab-${index}`
);
}
}
Expand All @@ -138,7 +138,7 @@ export default function DBTabs(props: DBTabsProps) {
onMount(() => {
state._id = props.id || state._id;

state._name = props.name || uuid();
state._name = `tabs-${props.name || uuid()}`;

state.initialized = true;
});
Expand Down

0 comments on commit a1c1951

Please sign in to comment.