Post

Replies

Boosts

Views

Activity

Comment on .keyboardShortcut on Button in Swift doesn't properly rerender unless button.label changes
I experienced a related issue when using a Mac with an extended keyboard. A button with .keyboardShortcut("5", modifiers: []) would trigger when using "5" on the numeric keypad, but would trigger an older action associated with "5" when using the numeric keys along the top of the keyboard. Adding localization: .withoutMirroring fixed the issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’23