Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initial isPressed registration in KeyboardShortcutsExample #191

Merged

Conversation

cweider
Copy link
Contributor

@cweider cweider commented Nov 30, 2024

The isPressed indicator was not changing for shortcuts created with the DynamicShortcutRecorder. This was caused by registration being done with .onChange(of:_:) - where action is only evaluated with the first change of the value. Specify initial so that it is evaluated on appearance as well.

The `isPressed` indicator was not changing for shortcuts created
with the `DynamicShortcutRecorder`. This was caused by registration
having been done with `.onChange(of:_:)` - where `action` is only
evaluated with the first change of the value. Specify `initial` so
that it is evaluated on appearance as well.
@sindresorhus sindresorhus merged commit db50681 into sindresorhus:main Nov 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants