mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
Merge pull request #10356 from Apetun/fix-setTab
Update Tabs.jsx to Fix setTab bug
This commit is contained in:
commit
d5bd75555a
1 changed files with 5 additions and 4 deletions
|
|
@ -95,10 +95,11 @@ export const Tabs = function Tabs({
|
|||
useEffect(() => {
|
||||
const exposedVariables = {
|
||||
setTab: async function (id) {
|
||||
if (id) {
|
||||
setCurrentTab(id);
|
||||
setExposedVariable('currentTab', id);
|
||||
fireEvent('onTabSwitch');
|
||||
if (id !== undefined) {
|
||||
const tabId = Number(id);
|
||||
setCurrentTab(tabId);
|
||||
setExposedVariable('currentTab', tabId);
|
||||
fireEvent('onTabSwitch')
|
||||
}
|
||||
},
|
||||
currentTab: currentTab,
|
||||
|
|
|
|||
Loading…
Reference in a new issue