-
Notifications
You must be signed in to change notification settings - Fork 16
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
[bug] keybing triggered unexpectedly even when the palette is not visible #16
Comments
Hey thanks for pointing this out, i have identified the issue and looking into this, thanks!! Sorry for the late response I am not receiving mails from github for some reason |
@litanlitudan Can you reproduce this in a codesandbox or a screencast maybe to get a better idea of what's happening? |
This is how I got it to work, basically copied your condition to another method. Hope this help people with the same issue in the future.
for context this method can be added inside the "defineActions" object |
I think i'll make a bug fix for this, by adding this condition before the action executes. Thank you for this @flare-s . Let me know if you want to take a shot at this. If not, I'll publishing a new version soon |
@litanlitudan This is a feature, keyboard shortcuts are meant to run when the palette isn't visible. You can use @flare-s 's solution to fix or not define keyboard shortcuts at all. |
@rohitpotato Sorry, life been hectic lately, but my colleague found a better way to implement this. Will share it once I have the code. Also, I wanted to say this package is really awesome! Thanks for sharing it with us. |
Basically, he Added this bit To the handleArrowUp and handleArrowDown functions in the CommandPalette.svelte file. |
This is problematic for the Therefor, the fix @flare-s pointed out first can not be applied.
I think it is necessary to implement the solution @flare-s propesed later or similar to run keyboard shortcuts used internally only while the modal is open and not prevent the default actions while closed for e.g.
|
Let me publish a new version based on the above feedback. |
Hi folks,
Thanks for creating such a cool project, really a great job!
I tried to integrate this module into one of my projects and noticed that the keybinding got overwrote unexpectedly.
For example, once I add the component to my app, my upArrow key won't work anymore, even without the palette being visible.
I noticed that in the codebase, svelte-command-pallete disable the default behavior of the keystroke:
svelte-command-palette/src/lib/components/CommandPalette.svelte
Line 112 in d09b60d
Is it possible to only enable the logic when the palette is visiable?
Also, there might be something wrong with my setup, as I am still learning svelte :)
Here is how I integrated the svelte-command-pallete
In file
/component/commandPallete.svelte
How I reference the component in the main app.svelte is as the following
Any help is appreciated, thanks!
The text was updated successfully, but these errors were encountered: