adrielcafe / voyager

🛸 A pragmatic navigation library for Jetpack Compose
https://voyager.adriel.cafe
MIT License
2.27k stars 109 forks source link

TabDisposable with nested/parent navigation loses Screen state #390

Open creativedrewy opened 1 month ago

creativedrewy commented 1 month ago

When navigating from inside a TabNavigator after locating a parent/outer Navigator, the Tabs will always be disposed by TabDisposable, resulting in the screen state being lost for the tabs. This issue occurs even if the outer/parent Navigator has disposeNestedNavigators = false set.

You can utilize the attached patch file to see the bug in action:

bug_reference.patch

This video shows patch in action as well; note the list scroll position is not retained when navigated back from the "green" screen:

https://github.com/adrielcafe/voyager/assets/2018851/3f7564ed-ae87-4ba1-9ccb-1f4a6552cc97