This has been posted before on here but none of the answers work. I have 6 navigation links within a navigation view but on some of them it randomly pops back to the root and says "Unable to present. Please file a bug." in the console. Here is my code for my NavigationView:
VStack {
NavigationLink(
destination: EventSetupQueueSelectionView()
.background(Color.neutral(.oneHundred))
.navigationBarTitle("")
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
,
tag: 1,
selection: $modelController.currentPage,
label: { EmptyView() }
)
NavigationLink(
destination: EventSetupQueueDetailsView()
.background(Color.neutral(.oneHundred))
.navigationBarTitle("")
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
,
tag: 2,
selection: $modelController.currentPage,
label: { EmptyView() }
)
NavigationLink(
destination: EventSetupSigningView()
.background(Color.neutral(.oneHundred))
.navigationBarTitle("")
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
,
tag: 3,
selection: $modelController.currentPage,
label: { EmptyView() }
)
NavigationLink(
destination: EventSetupRetailView()
.background(Color.neutral(.oneHundred))
.navigationBarTitle("")
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
,
tag: 4,
selection: $modelController.currentPage,
label: { EmptyView() }
)
NavigationLink(
destination: EventSetupPrivacyView()
.background(Color.neutral(.oneHundred))
.navigationBarTitle("")
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
,
tag: 5,
selection: $modelController.currentPage,
label: { EmptyView() }
)
NavigationLink(
destination: EventSetupSummaryView()
.background(Color.neutral(.oneHundred))
.navigationBarTitle("")
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
,
tag: 6,
selection: $modelController.currentPage,
label: { EmptyView() }
)
EventSetupDetailView()
.background(Color.neutral(.oneHundred))
.navigationBarTitle("")
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
}
}
The modelController.currentPage
is changed via a separate button below the navigation view. I've removed that for simplicity. If I reduce the number of NavigationLinks, it works but this is not a solution. How can I fix this?