Closed bfreeTax closed 2 years ago
Weird, do you really need to use a GeometryReader
there? Sometimes they give trouble and Pager
already contains one. Have you tried removing it?
Closing, this seems a SwiftUI
issue
I was able to get my implementation working by hiding the NavigationLink in the background of a button, similar to the second example here. I also added .buttonStyle(.plain)
, which prevents the button action from bubbling up to the list row – this allows you to have multiple buttons and/or NavigationLinks in the same row. Hopefully this helps someone:
Button {
isActive = true
} label: {
rowDetails.background(
NavigationLink(destination: detailsPage, isActive: $isActive) {
EmptyView()
}
.opacity(0.0)
)
}
.buttonStyle(.plain)
Describe the bug NavigationLink stops working if using
List
and useloopPages
falseTo Reproduce
loopPages()
Sample code: Using your InfiniteExampleView.swift
Expected behavior It Should works as it works using
VStack
.Screenshots / Videos If applicable, add screenshots to help explain your problem.
Environment:
Additional context Console shows this error:
SwiftUI encountered an issue when pushing aNavigationLink. Please file a bug.