NavigationLinks only work once?

Hi,


I have the issue (on iOS/iPadOS) once a NavigationLink was tapped/used it won't trigger the navigation again after navigating back. The most minimal code example would be:


struct ContentView: View {
  var body: some View {
    NavigationView {
      NavigationLink(destination: PushedView()) {
        Text("Press Me").font(.largeTitle)
      }
    }
  }

  struct PushedView: View {
    var body: some View {
      Text("Hello")
    }
  }
}


So once "Push Me" was tapped and the navigation triggered it won't work again after navigating back. (Only tested in simulator so far.) Am I missing something?


Kind regards,

Michael

Replies

UPDATE:

Seems to be simulator only.

I encountered the same situation when running app in simulator. I found that it is only for simulator with iOS 13.3. Below are my test results


iPhone 8 simulator with iOS 13.3 --- there is issue: NavigationLink no long work after navigating back

iPhone 8 simulator with iOS 13.2.2 --- OK

a physical iPhone with iOS 13.3 --- OK


luckly seems this is a simulator only issue and it is only for iOS 13.3. I hope it can be fixed in next iOS version.

iPhone 8 simulator with iOS 13.2.2 --- crashes


iPhone 8 simulator with iOS 13.3 --- there is issue: NavigationLink no long work after navigating back


when will this be fixed?

iPhone 8 simulator with iOS 13.3 --- there is issue: NavigationLink no long work after navigating back

To be more precise:

when you click a second time on a list item, nothing occurs: that's because the page is already selected.

Experiencing the same thing on the Simulator. What is interesting is that if you alternate - select the first row, go back, select the second row, go back, then you can select the first row again. The issue is that you cannot select the same row again.


Is there a bug report on this?

Yes. You condirm what I said…

Experiencing this bug on an AppleTV Device and AppleTV simulator. Is there a way to see the bug report?

Which bug report ? Did you file one ?


Is it really a bug ? Or the expected behavior, even though annoying.

When you see the split screen, retapping a selected link does not need to re-fire the link to recall the detail view.

But the problem when detail is hidden, is that it does not show the existing one.

There is a navigation link on an initial view. Pressing the link lanches a 2nd view. Hitting the menu button on the remote takes you back to the initial view. However, pressing the link no longer launches the 2nd view. This behaivor is consistent on the AppleTV simulator and an AppleTV Device. Additionally, the same code fails on the iphone simulator but works fine on an iPhone device. I will enter a bug report.

I was also able to get the 10.2 simulator to work, but 10.1 and 10.3 did not work after first click.