Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tab programmatically. activeTabIndex not work. #462

Open
lags opened this issue Feb 22, 2021 · 0 comments
Open

Change tab programmatically. activeTabIndex not work. #462

lags opened this issue Feb 22, 2021 · 0 comments

Comments

@lags
Copy link

lags commented Feb 22, 2021

With ionic 5 and react activeTabIndex of <SuperTabs> tag not work if value change.

const [tabIdx, setTabIdx] = useState(0);

For ex: Initial state of tabIdx is 0 so work properly but if tabIdx change with setTabIdx(2); nothing happen. I mean that component rerender successfully but tab not change.

In react mode how to change tab programmatically?

      <SuperTabs activeTabIndex={tabIdx} config={{ debug: false, sideMenu: 'left', allowElementScroll: true, nativeSmoothScroll: true }}>
        <SuperTabsToolbar slot="top" color="antracite">
          <SuperTabButton>
            <IonLabel>TestTAB1</IonLabel>
          </SuperTabButton>
          <SuperTabButton>
            <IonLabel>TestTAB2</IonLabel>
          </SuperTabButton>
          <SuperTabButton>
            <IonLabel>TestTAB3</IonLabel>
          </SuperTabButton>
        </SuperTabsToolbar>
        <SuperTabsContainer autoScrollTop>
          <TestTAB1 />
          <TestTAB2 />
          <TestTAB3 />
        </SuperTabsContainer>
      </SuperTabs>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant