Skip to content

Commit

Permalink
Merge pull request #6925 from Sage/FE-6346
Browse files Browse the repository at this point in the history
fix(tabs): tab headers jump in width when navigating through them
  • Loading branch information
mihai-albu-sage authored Sep 19, 2024
2 parents b722fd5 + 8883359 commit 2d7521b
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 2d7521b

Please sign in to comment.