From 90cd23a40511fea6bd0714bbf4b406520170b1ac Mon Sep 17 00:00:00 2001 From: Sugan G Date: Thu, 2 Nov 2023 15:08:29 +0530 Subject: [PATCH] Revert "[terra-tabs] Fixes tab label update (#1868)" This reverts commit 136e9a9b8d2d19ca6294136aeae8be6bb4ffad09. --- packages/terra-tabs/CHANGELOG.md | 4 ---- packages/terra-tabs/src/common-tabs/_Tabs.jsx | 8 +------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/terra-tabs/CHANGELOG.md b/packages/terra-tabs/CHANGELOG.md index e3eaadb54f2..8b2dbd89406 100644 --- a/packages/terra-tabs/CHANGELOG.md +++ b/packages/terra-tabs/CHANGELOG.md @@ -2,10 +2,6 @@ ## Unreleased -* Fixed - * Fixes issue where tab label fails to get updated due to - having the same key before and after tab label update. - ## 7.11.1 - (October 25, 2023) * Fixed diff --git a/packages/terra-tabs/src/common-tabs/_Tabs.jsx b/packages/terra-tabs/src/common-tabs/_Tabs.jsx index 0b63721df90..06796d28a40 100644 --- a/packages/terra-tabs/src/common-tabs/_Tabs.jsx +++ b/packages/terra-tabs/src/common-tabs/_Tabs.jsx @@ -159,16 +159,12 @@ class Tabs extends React.Component { const prevTab = prevProps.tabData.find((tab) => tab.isSelected === true); const currTab = this.props.tabData.find((tab) => tab.isSelected === true); const prevtabKeys = []; - const prevtabLabels = []; prevProps.tabData.forEach(child => { prevtabKeys.push(child.id); - prevtabLabels.push(child.label); }); const curtabKeys = []; - const curtabLabels = []; this.props.tabData.forEach(child => { curtabKeys.push(child.id); - curtabLabels.push(child.label); }); // Allow dynamic addition of tabs. @@ -179,10 +175,8 @@ class Tabs extends React.Component { let isTabEqual = false; for (let i = 0; i < curtabKeys.length; i += 1) { const prevKey = prevtabKeys[i]; - const prevLabel = prevtabLabels[i]; const curKey = curtabKeys[i]; - const curLabel = curtabLabels[i]; - if (prevKey !== curKey || prevLabel !== curLabel) { + if (prevKey !== curKey) { isTabEqual = true; } }