Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-samuel committed Dec 6, 2024
1 parent d41734d commit 9b38155
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/javascript/components/miq-custom-tab/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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');
}
Expand All @@ -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,
};

0 comments on commit 9b38155

Please sign in to comment.