fermoya / SwiftUIPager

Native Pager in SwiftUI
MIT License
1.31k stars 172 forks source link

[BUG] tvOS NavigationLink not work #308

Open isaced opened 1 year ago

isaced commented 1 year ago

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:

Additional context

metin-atalay commented 1 year ago

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