How come keyboard shortcuts associated to toolbar items do not show up when you hold down the command key?
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Button {
} label: {
Text("Tap Me!")
}
.keyboardShortcut("o", modifiers: .command)
}
.padding()
.toolbar {
ToolbarItem {
Button {
} label: {
Image(systemName: "bolt")
}
.keyboardShortcut("k", modifiers: .command)
}
}
}
}
}
See screenshot. The shortcut for "Tap Me!" is being shown but not the one for the toolbar item. Am I doing something wrong or this is just not supported yet in SwiftUI? If that's the case, that seems to be a significant omission.