kbar
kbar copied to clipboard
Toggle KBar shortcuts when input/textbox is focused
Hi, thank you for this great lib. In my case I have some shortcuts with $mod
sequence, like the default KBar $mod+k
.
When the input or textbox focused this shortcuts are not working because of this function -https://github.com/timc1/kbar/blob/main/src/utils.ts#L101
But the default $mod+k
works anyway. Maybe we can add an option for each shortcut which defines is this shortcut ignore on focused elements or not.
Hey, I created PR for the behavior you described. Also needed such functionality, so maybe we could upvote the issue
https://github.com/timc1/kbar/pull/242
Hm, this is interesting – so when kbar is opened, you want specific shortcuts; ie $mod+p
to trigger actions? Once triggered, kbar will then close?
@timc1 Hey! In my case I have code editor input, when this editor is focused I want to toggle kbar shortcuts. Right now only $mod+K
works this way (opens default kbar search). But it would be perfect if I could trigger different shortcuts.
#242 adds this functionality, but maybe we can set in kbar options what shortcuts are available from focused inputs (maybe not all $mod+*
shortcuts need to handle this way)
@timc1 by the logic of the kbar we can see that if an action has perform a function then it will close automatically. I can see a few ways of handling shortcuts either by the ability to specify focused elements when shortcuts can or can't be fired or by specifying patterns in which shortcuts can be fired when the kbar is opened
Hey @timc1! Any updates on this?
@notmedia please see https://github.com/timc1/kbar/pull/242#issuecomment-1236428377 thank you!
Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.