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

Fix initialPage prop of Tabs component for IOS #1337

Closed
wants to merge 1 commit into from

Conversation

VahidBo
Copy link
Contributor

@VahidBo VahidBo commented Oct 31, 2017

Motivation

The initialPage prop of Tabs component is not working in IOS devices.

Test Plan

For this code:

...
        <Tabs initialPage={2}>
          <Tab heading="Tab1">
            <Tab1 />
          </Tab>
          <Tab heading="Tab2">
            <Tab2 />
          </Tab>
          <Tab heading="Tab3">
            <Tab3 />
          </Tab>
        </Tabs>
...

Before fixing this issue, the content of the initial tab (in this case Tab3) will render but the first tab is showing and then nothing will be showing in the tab. After this fixing, the right tab will show in the page. In this way the initialPage prop will work properly in IOS devices.
This commit will also fix #1318 and #1010.

@akhil-ga
Copy link
Contributor

@VahidBo tried your fix. Don't think the issue is fixed.

Gif

tabs

@tiberiumihai
Copy link

tiberiumihai commented Nov 17, 2017

This is because InteractionManager.runAfterInteractions(f) happen to sometimes never call f. Specially in DEV mode.

I've added a PR here: #1376

@SupriyaKalghatgi
Copy link
Contributor

@VahidBo Are you planning to fix this PR?

@tiberiumihai
Copy link

tiberiumihai commented Nov 29, 2017

@SupriyaKalghatgi I fixed this in #1376. It's basically the same fix as @VahidBo provided, only that is also included a fix for IteractionManager which happens to never call the callback sent to runAfterInteractions.

And because of this, InteractionManager.runAfterInteractions(scrollFn); never run.

You can check the whole fix in #1376.

@SupriyaKalghatgi
Copy link
Contributor

@tiberiumihai Yes i have gone through it
Since @VahidBo initiated this PR, i should be asking him for fix before closing this PR

@SupriyaKalghatgi
Copy link
Contributor

@VahidBo Closing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rendering error on Tabs when initialPage is not 0
4 participants