Skip to content

Commit

Permalink
fix(tabs): ellipsis should only be applied with vertical variant (#17004
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ariellalgilmore authored and tay1orjones committed Jul 22, 2024
1 parent 242ffdd commit ddf13d7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react/src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1217,10 +1217,12 @@ const Tab = forwardRef<HTMLElement, TabProps>(function Tab(
useLayoutEffect(() => {
function handler() {
const elementTabId = document.getElementById(`${id}`) || tabRef.current;
const newElement = elementTabId?.getElementsByClassName(
`${prefix}--tabs__nav-item-label`
)[0];
isEllipsisActive(newElement);
if (elementTabId?.closest(`.${prefix}--tabs--vertical`)) {
const newElement = elementTabId?.getElementsByClassName(
`${prefix}--tabs__nav-item-label`
)[0];
isEllipsisActive(newElement);
}
}
handler();
window.addEventListener('resize', handler);
Expand Down

0 comments on commit ddf13d7

Please sign in to comment.