Have you tried .simultaneousGesture() instead of .onTapGesture()? Certain views, like NavigationLink views, already have built-in tap gesture detection, so .onTapGesture() doesn't work.
simultaneousGesture() "attaches a gesture to the view to process simultaneously with gestures defined by the view."
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: