Skip to content

Commit a1d2880

Browse files
authored
fix selected tab style issues (#3283)
* move --selected-tab-pseudo-content var to TabList * disable pointer events inside tabs * add changeset
1 parent 6232ca1 commit a1d2880

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.changeset/floppy-tires-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sumup-oss/circuit-ui": patch
3+
---
4+
5+
Fixed minor styling issues with the selected tab indicator in the TabList component.

packages/circuit-ui/components/Tabs/components/Tab/Tab.module.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
.base {
2-
--selected-tab-pseudo-content: "";
3-
42
float: left;
53
display: flex;
64
flex-direction: column;
@@ -22,6 +20,10 @@
2220
transition: color var(--cui-transitions-default);
2321
}
2422

23+
.base > * {
24+
pointer-events: none;
25+
}
26+
2527
.base:hover {
2628
color: var(--cui-fg-normal-hovered);
2729
}

packages/circuit-ui/components/Tabs/components/TabList/TabList.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
}
5252

5353
.base {
54+
--selected-tab-pseudo-content: "";
55+
5456
position: relative;
5557
display: flex;
5658
flex-wrap: nowrap;

packages/circuit-ui/components/Tabs/components/TabList/TabList.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ export const TabList = forwardRef<HTMLDivElement, TabListProps>(
5858
const stretchOnMobile = numberOfTabs <= MOBILE_AUTOSTRETCH_ITEMS_MAX;
5959

6060
const updateGliderStyles = useCallback((tab: HTMLElement) => {
61-
tab.style.setProperty('--selected-tab-pseudo-content', 'unset');
61+
tabListRef.current?.style.setProperty(
62+
'--selected-tab-pseudo-content',
63+
'unset',
64+
);
6265
const { offsetLeft, offsetWidth } = tab;
6366
gliderRef.current?.style?.setProperty(
6467
'transform',

0 commit comments

Comments
 (0)