diff --git a/app/javascript/components/miq-custom-tab/index.jsx b/app/javascript/components/miq-custom-tab/index.jsx index fbd6a9540fe..2e47cae8c01 100644 --- a/app/javascript/components/miq-custom-tab/index.jsx +++ b/app/javascript/components/miq-custom-tab/index.jsx @@ -10,7 +10,6 @@ const MiqCustomTab = ({ }) => { const dispatch = useDispatch(); const [data, setData] = useState({ loading: false }); - const [currentTab, setCurrentTab] = useState(activeTab); const activeTabClassName = 'bx--tabs--scrollable__nav-item--selected'; const selectedClassName = 'bx--tabs__nav-item--selected'; @@ -115,7 +114,7 @@ const MiqCustomTab = ({ elements[tabLength].classList.remove(activeTabClassName); elements[subtab + tabLength].classList.add(activeTabClassName); } - elements[currentTab].classList.add(activeTabClassName); + elements[activeTab].classList.add(activeTabClassName); elements = document.getElementsByClassName('bx--tabs--scrollable__nav-item'); } @@ -136,9 +135,11 @@ MiqCustomTab.propTypes = { type: PropTypes.string.isRequired, activeTab: PropTypes.number, subtab: PropTypes.number, + tabLength: PropTypes.number, }; MiqCustomTab.defaultProps = { activeTab: undefined, subtab: undefined, + tabLength: undefined, };