Menu("+") {
Button("add") {
print("add")
}
.keyboardShortcut("a", modifiers: [.command])
}
The menu button not show keyboard shortcut label, and the shortcut function can not be used. I don't know if this is a bug or a function lack, obviously it not working as I expected.
My environment: macOS Monterey 12.1 (21C52) XCode 13.1
Post
Replies
Boosts
Views
Activity
Here is the simplest code, i find father View's onTapGesture modify will override ColorPicker, i think it's a bug, or is there any way to solve it
struct TestView: View {
@State var color: Color = .red
var body: some View {
VStack{
Spacer()
ColorPicker("pick bgColor", selection: $color)
Spacer()
}
.background(color)
.onTapGesture {
print("click blank space")
}
}
}