indieSoftware/NavigationStack

Programmatic navigation doesn't always succeed

Closed this issue · 2 comments

dsa commented

I've found that the following code doesn't work deterministically:

https://gist.github.com/dsa/badf6ab7a8dd7ec9dcbcc9a5e0f9b459

"called me" is indeed printed every time, but the transition, sometimes does not occur. Any ideas here?

You're right, when running this code multiple times then sometimes the transition doesn't happen even thought the nav stack is correctly set.

I've created Experiment10 and it seems I could find a fix for this. I'm not 100% sure why this issue happens, but I guess it's just another SwiftUI oddity.

Anyway, please have a look at the issue1 branch if this works now for you. Would be nice if you could verify that this issue is really solved.

It seems this issue was solved by iOS 14.5. I've created a UI test to v1.1 which verifies this.