My SwiftUI list turn empty when scroll down

I have a SwiftUI List pushed through NavigationLink. But when I scroll down the data suddenly turn empty. Not sure why? Xcode 14.2 Here's my implementation

  • Parent View (doesn't has issue)
NavigationView {
      List {
        ForEach(viewModel.endorsements, id: \.name) { endorsement in
          EndorsementListItem(endorsement: endorsement)
            .background {
              NavigationLink {
                viewModel.buildEndorsmentListDetail(endorsement)
              } label: {
                EmptyView()
              }.opacity(0)
            }
          .padding(.vertical, 16)
          .listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
        }
      }
      .padding(.horizontal, 12)
      .listStyle(.plain)
...

  • Child View (which has the issue)
struct EndorsementListDetail: View {
var body: some View {
        List {
          ForEach(viewModel.endorsement.details) { detail in
            VStack(spacing: 8) {
              EndorsementListDetailItem(detail: detail)
              Divider()
            }
            .listRowSeparator(.hidden)
            .listRowInsets(EdgeInsets(top: 8, leading: 12, bottom: 0, trailing: 12))
          }
        }
        .listStyle(.plain)
...
}

When I scroll down, the list turn empty

Anyone have any idea why this is happening?

The issue does not happen when I wrapped all my view in hosting vc, then put them all in a navigationController. I guess something is wrong with SwiftUI NavigationLink.

Note: when you post screenshots, please reduce their size : see advice #10 here: https://developer.apple.com/forums/thread/706527

Does the list disappear immediately as soon as you start scrolling down ? What happens if you scroll up later ? Does the list reappear ? COuld it be that you scroll beyond the end of the list ?

My SwiftUI list turn empty when scroll down
 
 
Q