fix/tab-switch-event (#10455)

This commit is contained in:
Shaurya Sharma 2024-07-26 08:34:05 +05:30 committed by GitHub
parent 67d8dfcb9a
commit d92f30f984
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,7 +96,7 @@ export const Tabs = function Tabs({
useEffect(() => {
const exposedVariables = {
setTab: async function (id) {
if (id) {
if (id && currentTab !== id) {
setCurrentTab(id);
setExposedVariable('currentTab', id);
fireEvent('onTabSwitch');
@ -162,6 +162,7 @@ export const Tabs = function Tabs({
className="nav-item"
style={{ opacity: tab?.disabled && '0.5', width: tabWidth == 'split' && '33.3%' }}
onClick={() => {
if (currentTab === tab.id) return;
setTabSwitchingOnProgress(true);
!tab?.disabled && setCurrentTab(tab.id);