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 for Tabs #1376

Merged

Conversation

tiberiumihai
Copy link

@tiberiumihai tiberiumihai commented Nov 17, 2017

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

For more info check: https://github.com/facebook/react-native/issues/8624#issuecomment-231040370

@SupriyaKalghatgi
Copy link
Contributor

@tiberiumihai Seems like you did not go through Contribution Guidelines

Please check it and update your code

@SupriyaKalghatgi
Copy link
Contributor

You cannot edit code in dist

@tiberiumihai
Copy link
Author

My bad. I'll update the PR.

@SupriyaKalghatgi
Copy link
Contributor

@tiberiumihai Any updates on this

@tiberiumihai
Copy link
Author

tiberiumihai commented Dec 7, 2017

I've removed the changes from dist folder and left only the changes from src.

I used the contributing guideline to also test this in a new project.

This should be solved now.

Gif Demo - NativeBase: Fix Initial Tab

@ecnaidar
Copy link

ecnaidar commented Dec 7, 2017

@tiberiumihai
Fix works in simple test case (still incorrectly renders in debug mode, though).
In the actual application does not work for both debug and release

Issue is rather frustrating and apparently somewhere deep in RN, since I was able to follow call to scrollTo in Interaction Manager. Correct values are going through up to the place where it is bridged to native module aaand ✨magically✨ nothing happens.

@tiberiumihai
Copy link
Author

tiberiumihai commented Dec 7, 2017

@ecnaidar
What do you mean "in simple test case"?
Do you have another use case in which this fix doesn't work?

Try to increase the InteractionManager's setTimeout time, probably your app is not so responsive due to some js processing and it needs more time to run the function.

@ecnaidar
Copy link

ecnaidar commented Dec 7, 2017

@tiberiumihai Just several tabs with text.
I have tried fiddling with timeout time, did not help. I suspect that animations in higher component hierarchy are interfering.

EDIT
Ok, empty tabs at the same place as ones that I need to have are rendered correctly around 4/10 times
The more tabs there are the lower the chances lmao (timeout value variation has not effect)

@ecnaidar
Copy link

ecnaidar commented Dec 11, 2017

#1443 This fixes issue for my specific case so apparently it makes situation better but certainly not a robust solution as heavier content breaks it

@SupriyaKalghatgi
Copy link
Contributor

@tiberiumihai Indicator issue in case of changing initialPage value while hot reload

@aliwesome
Copy link

this issue is not fixed yet!

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

Successfully merging this pull request may close these issues.

None yet

4 participants