过滤ForEach时,SwiftUI导航链接不起作用

我有一个分段选择器来筛选ForEach内的列表行,但是NavigationLinks在筛选时停止工作,它们具有点击动画,但从不更改视图。我在甲板上使用CoreData。当我点击“标准”中的行时,它们可以正常工作,然后点击“百搭”,导航链接仍然有效,但是当我返回到“标准”时,将发生以下情况:

enter image description here

这是我的代码:

var body: some View {

        VStack {
            NavigationView {

                List {
                    FormatPicker(formats: formats, selectedFormat: $selectedFormat)
                        .padding(.top, 10)

                    ForEach(decks.filter{$0.format == formats[selectedFormat]}, id: \.self) { deck in
                        HStack {
                            ZStack {
                                DeckRow(deck: deck)
                                NavigationLink(destination: DeckView()) {
                                    EmptyView()
                                }
                            }
                        }
                    }
                    .onDelete { index in
                        for deck in index {
                            self.managedObjectContext.delete(self.decks[deck])
                        }
                        do {
                            try self.managedObjectContext.save()
                        } catch {
                            // handle the Core Data error
                        }
                    }
                    .onMove { (source: IndexSet, destination: Int) in

                    }

                    Button(action: {self.showNewDeck.toggle()}) {
                        NewRow(text: "Add New Deck")
                    }

                }
                .navigationBarTitle(Text("Decks"))
                .navigationBarItems(
                    leading:  EditButton(),
                    trailing: Button(action: {
                        self.showNewDeck.toggle()

                    }) {

                        Image(systemName: "plus")
                            .font(.system(size: 20, weight: .medium))
                            .frame(width: 36, height: 36)
                    }


                )

            }
            Text("").hidden().sheet(isPresented: $showNewDeck, onDismiss: {self.showNewDeck = false}) {
                NewDeckView().environment(\.managedObjectContext, self.managedObjectContext)
            }
        }
    }