Skip to content

Commit

Permalink
fix: use Object.assign to tabTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfrancois committed Oct 24, 2023
1 parent 1098993 commit 2085bc0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/design-system/src/components/Tabs/variants/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ export function Tabs(props: TabsProps) {
tabProps['aria-controls'] = ids[index];
tabProps.title = tab.tabTitle;
} else if (typeof tab.tabTitle === 'object') {
tabProps['aria-controls'] = tab.tabTitle.id || ids[index];
tabProps.title = tab.tabTitle.title;
tabProps.icon = tab.tabTitle.icon;
tabProps.tag = tab.tabTitle.tag;
tabProps.tooltip = tab.tabTitle.tooltip;
tabProps.disabled = tab.tabTitle.disabled;
const { id, ...rest } = tab.tabTitle;
tabProps['aria-controls'] = id || ids[index];
Object.assign(tabProps, rest);
}
return <Tab key={index} {...(tabProps as TabPropTypes)} />;
})}
Expand Down

0 comments on commit 2085bc0

Please sign in to comment.