Skip to content

Commit

Permalink
fix(AdaptiveTabs): fix border-case with incorrect firstHiddenTabIndex…
Browse files Browse the repository at this point in the history
… from small to next size
  • Loading branch information
artemipanchuk committed Feb 27, 2024
1 parent e7c2a4e commit 6d170fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/AdaptiveTabs/AdaptiveTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,11 @@ export class AdaptiveTabs<T> extends React.Component<AdaptiveTabsProps<T>, Adapt
}
}

if (maxHiddenTabWidth) {
if (maxHiddenTabWidth && typeof firstHiddenTabIndexForSequentialCase === 'number') {
let rightSpace = maxHiddenTabWidth - emptySpace;

for (let j = firstHiddenTabIndexForSequentialCase! - 1; j >= 0; j--) {
rightSpace = rightSpace - this.tabsWidth[j];
for (let j = firstHiddenTabIndexForSequentialCase - 1; j >= 0; j--) {
rightSpace = rightSpace - maxHiddenTabWidth;

if (rightSpace < 0) {
firstHiddenTabIndex = j + (tabChosenFromSelectIndex > j ? 0 : 1);
Expand Down

0 comments on commit 6d170fb

Please sign in to comment.