From db506816e7a088908d76d26c308d5405e65ad079 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Fri, 29 Nov 2024 23:44:28 -0800 Subject: [PATCH] Fix initial `isPressed` registration in `KeyboardShortcutsExample` (#191) --- Example/KeyboardShortcutsExample/MainScreen.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/KeyboardShortcutsExample/MainScreen.swift b/Example/KeyboardShortcutsExample/MainScreen.swift index 2f2690a..915e544 100644 --- a/Example/KeyboardShortcutsExample/MainScreen.swift +++ b/Example/KeyboardShortcutsExample/MainScreen.swift @@ -66,7 +66,7 @@ private struct DynamicShortcut: View { .frame(maxWidth: 300) .padding() .padding(.bottom, 20) - .onChange(of: shortcut) { oldValue, newValue in + .onChange(of: shortcut, initial: true) { oldValue, newValue in onShortcutChange(oldValue: oldValue, newValue: newValue) } }