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 committed Jul 19, 2024
1 parent b4a89ef commit 6c4a25e
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 6c4a25e

Please sign in to comment.