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

Gap between header and content if lazy === true #19

Closed
PedroBern opened this issue Dec 4, 2020 · 2 comments · Fixed by #49
Closed

Gap between header and content if lazy === true #19

PedroBern opened this issue Dec 4, 2020 · 2 comments · Fixed by #49
Labels
bug Something isn't working good first issue Good for newcomers v2

Comments

@PedroBern
Copy link
Owner

PedroBern commented Dec 4, 2020

Current behavior

<CollapsibleTabView lazy ...> do not sync scroll position of unmounted routes, as expected, because the routes are unmounted! But, when the routes are mounted, may start with a gap between the header and the content.

Expected behaviour

When mounting the lazy routes, they should know the header position and start with the correct scroll position.

Workaround

The current workaround is to handle the laziness by yourself. What actually can be a good thing, since the lazy prop of react-native-tab-view is pseudo-lazy. It loads all routes if you click on the last tab!

@PedroBern PedroBern added bug Something isn't working good first issue Good for newcomers labels Dec 4, 2020
@PedroBern PedroBern changed the title Screens do not sync if using lazy=true Screens may start with gap between header and content if lazy = true Dec 4, 2020
@PedroBern PedroBern changed the title Screens may start with gap between header and content if lazy = true Gap between header and content if lazy = true Dec 4, 2020
@PedroBern PedroBern changed the title Gap between header and content if lazy = true Gap between header and content if lazy === true Dec 4, 2020
@Janak-Nirmal
Copy link

@PedroBern Is there any solution to fix this issue, using lazy={true} is necessary if we don't want to load all the data until user really visits that tab.

@PedroBern
Copy link
Owner Author

@PedroBern Is there any solution to fix this issue, using lazy={true} is necessary if we don't want to load all the data until user really visits that tab.

@Janak-Nirmal as I wrote above:

The current workaround is to handle the laziness by yourself. What actually can be a good thing, since the lazy prop of react-native-tab-view is pseudo-lazy. It loads all routes if you click on the last tab!

@PedroBern PedroBern mentioned this issue Jan 14, 2021
@PedroBern PedroBern added the v2 label Jan 23, 2021
PedroBern added a commit that referenced this issue Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants