Repository navigation
Replies: 1 comment
|
You can do this today by returning an empty array when the input is empty. Since readonly optionalHotkey = input<RegisterableHotkey>()
constructor() {
injectHotkey(() => this.optionalHotkey() ?? [], () => {
// do actions
})
}The getter is reactive. The hotkey registers when the input gets a value and unregisters when it goes back to |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
injectHotkeysupports passing a signal as ahotkeyargument but it does not support undefined for the signal.It would be useful if the hotkey is registered optionally based on the component/directive input:
Right now the only workaround I found is setting some random default hotkey and disabling it:
All reactions