Skip to content

Commit

Permalink
fix(tabs): tab headers jump in width when navigating through them
Browse files Browse the repository at this point in the history
when using headerWidth the min width of the styled tab is updated

fixes: #6554
  • Loading branch information
mihai-albu-sage committed Sep 12, 2024
1 parent 1620297 commit 7c70261
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/tabs/tabs.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe("Tabs", () => {
describe.each(["35%", "100px", "5em"])(
"and value of %s is provided",
(headerWidth) => {
it("should render correct `width` in `TabsHeader` component, and `Tab` `width` should be `auto`", () => {
it("should render correct `width` in `TabsHeader` component, and `Tab` `width` should be computed based on the headerWidth", () => {
const wrapper = mount(
<Tabs position="left" headerWidth={headerWidth}>
<Tab title="Tab Title 1" tabId="uniqueid1">
Expand All @@ -271,7 +271,7 @@ describe("Tabs", () => {

assertStyleMatch(
{
width: "auto",
width: `calc(100% - ${headerWidth})`,
},
wrapper,
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/tabs.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const StyledTabs = styled.div<StyledTabsProps>`
}
${StyledTab} {
width: auto;
width: ${`calc(100% - ${headerWidth})`};
}
`}
Expand Down

0 comments on commit 7c70261

Please sign in to comment.