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

Container Lazy and Tabs.Lazy bug #275

Closed
burgetrostislav opened this issue Jul 4, 2022 · 7 comments · Fixed by #394
Closed

Container Lazy and Tabs.Lazy bug #275

burgetrostislav opened this issue Jul 4, 2022 · 7 comments · Fixed by #394
Labels
question Further information is requested

Comments

@burgetrostislav
Copy link

Hi, I have found bug with repositioning of Tabs with lazy loading. Loading is using index of lazy component which doesn't change position. So It loads Tabs based on their original position.

E.g. original Tabs: Tab0, Tab1, Tab2
If you change position of tabs to: Tab0, Tab2, Tab1
Then on click Tab2 you will load Tab1, but Tab2 will stay unloaded. It will be loaded only if 1) it was loaded before changing tab position or 2) if you click on Tab1 as it has index of Tab2 original position.

In Expo examples this should be in example: 15. Adding and removing tabs dynamically
Where you can add Tabs and shuffle them, but right now example is not working (you cannot Add new tab).
Here is example build locally without images:
LazyOrderingBug

I haven't found a way how to get around this. Please consider fixing this issue as it disable the option of lazy loading if you have sorting or ordering of tabs.

@burgetrostislav burgetrostislav added the question Further information is requested label Jul 4, 2022
@andreialecu
Copy link
Collaborator

PRs are more than welcome!

Shouldn't be hard to fix.

@burgetrostislav
Copy link
Author

I have looked at it, but I have not found any simple changes that would effectively fix this bug. Could you please take a look at it?

@nica0012
Copy link

I too am having this issue. when changing between user profiles that have different tabs, it does not know which one to use behind the scenes

@FabianDean
Copy link

Running into a similar issue -- haven't found a solution yet but will keep looking

@andreialecu
Copy link
Collaborator

#394 should fix this, I released it as 7.0.1-beta.0 on npm. Please help test it for unwanted side effects and report back. Thanks!

@FabianDean
Copy link

@andreialecu Will give this a try! Cheers 👍

@FabianDean
Copy link

@andreialecu From what I've tested so far, the issue seems to have been fixed 🤞

I had a workaround where I was using tab names as a key for Tabs.Container, but that isn't the most practical solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants