Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iOSappssolutions/8607d1b316dab94da1d219e5efcf7d70 to your computer and use it in GitHub Desktop.
Save iOSappssolutions/8607d1b316dab94da1d219e5efcf7d70 to your computer and use it in GitHub Desktop.
Tapping on Menu activates NavigationLink in visionOS
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
NavigationLink(value: "1") {
HStack {
Text("Test menu")
Menu {
Button {
print("tapped button")
} label: {
Label("test", systemImage: "plus")
}
} label: {
Image(systemName: "ellipsis")
}
.contentShape(.circle)
}
}
}
.navigationDestination(for: String.self) { _ in
Text("Navigation triggered")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment