SwiftUIPager icon indicating copy to clipboard operation
SwiftUIPager copied to clipboard

[BUG] tvOS NavigationLink not work

Open isaced opened this issue 2 years ago • 1 comments

Describe the bug Swiping, rendering all work, bug unable to click on tvOS with NavigationLink content.

To Reproduce

struct ContentView: View {
    
    @StateObject var page: Page = .first()
    var data = Array(0..<10)
    
    var body: some View {
        NavigationStack {
            VStack {
                NavigationLink(destination: EmptyView()) {
                    Text("Hello, world!")
                }
                
                Pager(page: page, data: data, id: \.self) { item in
                    NavigationLink(destination: EmptyView()) {    // ==> BUG? can't jump to EmptyView
                        Text("\(item)")
                    }
                    .background(.gray)
                }
                .preferredItemSize(CGSize(width: 300, height: 300))
                .itemSpacing(20)
                .frame(height: 500)
            }
        }
        .padding()
    }
}

I packaged a sample project to reproduce the issue, you can just download and open it with xcode, and run it on the Apple TV simulator.

SwiftUIPagerTVOSDemoProject.zip

Expected behavior NavigationLink can jump

Screenshots / Videos

image

Environment:

  • OSX: tvOS
  • Device Apple TV 4K (3dr generation) Simulator
  • SwiftUIPager version: 2.5.0

Additional context

isaced avatar Jan 29 '23 05:01 isaced

You are right. We have some bugs in tvOs side.

metin-atalay avatar Apr 14 '23 18:04 metin-atalay