Skip to content

Commit

Permalink
Fix tab errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcconechy committed Apr 5, 2024
1 parent bc4eb48 commit 4bc2782
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Expand Up @@ -9,6 +9,8 @@
## v4.95.0 Fixes

- `[Forms]` Fixed fileupload layout in compact form. ([#8537](https://github.com/infor-design/enterprise/issues/8537))
- `[Tabs]` Fixed error in tab popup. ([#8596](https://github.com/infor-design/enterprise/issues/8596))


## v4.94.0

Expand Down
20 changes: 10 additions & 10 deletions src/components/tabs/tabs.js
Expand Up @@ -3412,15 +3412,15 @@ Tabs.prototype = {
for (let i = 0; i < tabs.length; i++) {
tab = tabs.eq(i);
a = tab.children('a');
a[0].style.width = '';
if (a[0]) a[0].style.width = '';

if (!this.settings.headerTabsTooltips || this.settings.maxWidth === null) {
let diff = 0;
if (env.os.name === 'ios' && env.devicespecs.isMobile && isSideBySide) {
diff = 25;
}
tabs[i].style.width = `${visibleTabSize - diff}px`;
a[0].style.width = `${visibleTabSize - diff}px`;
if (a[0]) a[0].style.width = `${visibleTabSize - diff}px`;
}

if (this.settings.moduleTabsTooltips || this.settings.multiTabsTooltips || this.settings.headerTabsTooltips) {
Expand All @@ -3430,13 +3430,13 @@ Tabs.prototype = {

if (this.settings.maxWidth !== null && a[0].scrollWidth > a.innerWidth()) {
cutoff = 'yes';
}
}

if (this.settings.maxWidth === null && prevWidth > (visibleTabSize - anchorPadding)) {
cutoff = 'yes';
}

a.data('cutoffTitle', cutoff);
a?.data('cutoffTitle', cutoff);
}
}
},
Expand Down Expand Up @@ -3564,21 +3564,21 @@ Tabs.prototype = {
}
}

popupLi[0].removeAttribute('style');
popupA[0].removeAttribute('style');
popupLi[0]?.removeAttribute('style');
popupA[0]?.removeAttribute('style');

popupLi.children('.icon').off().appendTo(popupA);
popupLi.appendTo(menuHtml);

// Link tab to its corresponding "More Tabs" menu option
$item.data('moremenu-link', popupA);
popupA.find('.icon-more').removeData().remove();
popupA?.find('.icon-more').removeData().remove();

// Link "More Tabs" menu option to its corresponding Tab.
// Remove onclick methods from the popup <li> because they are called
// on the "select" event in context of the original button
popupA.data('original-tab', $itemA);
popupA.onclick = undefined;
popupA?.data('original-tab', $itemA);
if (popupA) popupA.onclick = undefined;

if (!$item.is('.has-popupmenu')) {
return;
Expand Down

0 comments on commit 4bc2782

Please sign in to comment.