SwiftUI NavigationLink with action in List

I have a use case where I want to navigate to a destination view but also perform an event when the user interacts.

Outside of a List this code seems to work:

NavigationLink(destination: MyDestinationView()) {
  HStack { /* content here */ }
}
.simultaneousGesture(TapGesture().onEnded { /* my action */ })

However, once you put that in a List either the navigation or the action, not both, will fire. Typically tapping anywhere in the HStack will navigate, but tapping on the Text objects will fire the action and not navigate. Is this an issue with List or is there an intended way of doing this that I am not seeing?

I also messed with contentShape and it ended up making the HStack fire the action and only the very edges of the cell would navigate. Like the rowItem could only handle 1 gesture event at a time.

I tried something like in the ForEach creating a view that had a body of: (view also had a state var of shouldNavigate)

Group {
  NavigationLink(destination: MyView(), isActive: $shouldNavigate) { EmptyView() }
  Button(action: { shouldNavigate = true }) {
    HStack { /* myContent */ }
  }
}

and that did not have the intended affect and made individual rows: one empty with chevron and one with the content but no chevron.

It might be cleaner to have the action take place in the view you are navigating to, using .onAppear?

Edit: also a potential problem with just adding .onAppear to the destination is that will technically fire every time that instance is shown, not just initial navigation. So if that page navigated somewhere and the user hits back, the action would be fired again. There is probably a way of adding a modifier and having checks to only fire the action once... but at the point it still seems like its adding complexity for a very common and simple behavior.

Any updates on this one? Were you able to find a solution, I'm running into a similar issue.

SwiftUI NavigationLink with action in List
 
 
Q