-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Hello 👋,
I found a really strange navigation issue when I have a root ManagedNavigationStack which has TabBar inside and each tab has its own ManagedNavigationStack.
The issue happens when I try to push new view from the inner ManagedNavigationStack to the root one (I want the new view to be above the TabBar), then when I dismiss the pushed view using system back button and repeat this several times I see that multiple views were pushed to the stack (note: if you use navigator.pop() this issue doesn't happen, it's only happening with the system back button and back gesture)
Here is a code example which produces the above described issue (tested on the newest Navigator 1.4.6):
struct ContentView: View {
var body: some View {
ManagedNavigationStack { rootNavigator in
ZStack {
TabView {
ManagedNavigationStack { tabNavigator in
VStack {
// Tap this button, then tap the system back button - repeat several times to see the issue
Button("Present above TabBar") {
rootNavigator.navigate(to: TestNavigationDestination.test)
}
Button("Present below TabBar") {
tabNavigator.navigate(to: TestNavigationDestination.test)
}
}
}
}
}
}
}
}
enum TestNavigationDestination: NavigationDestination {
case test
var body: some View {
ProgressView()
}
}
Expected behavior
- After tapping
Present above TabBarthe view should sit above theTabBar - After tapping
Present below TabBarthe view should sit below theTabBar
How can I achieve this behavior without the multiplying stack issue?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels