Describe the bug
I'm trying to add functionality to manually toggle the command bar. The problem is that when I run query.toggle
according to this documentation, nothing is happening.
To Reproduce
Steps to reproduce the behavior:
- Clone this repository
- Checkout the
kbar-error
branch
- Click on the button all the way to the right in the
Navbar
The component for toggling the command bar is contained in CommandPaletteToggle
.
Expected behavior
We are expecting the prompt to show up just like it would if you used the key combo cmd+k
Screenshots
Button is all the way on the right
Changes made
- I added the
CommandPaletteToggle
component and its file entirely, the component can be found to the far right side of the Navbar
- I added the
CommandPaletteToggle
in LayoutWrapper.js
which is how the component is actually displayed on the Navbar
- I added a wrapper
KBarProvider
in app.js
as instructed so that I could import the useKBar
hook in CommandPaletteToggle
.
Additional context
Here is a working example that I based my attempt off of.
I found some commentary that the component where I am using the useKBar
hook (on line 6 of CommandPaletteToggle
) has to be wrapped with a KBarProvider
component which I did on line 26 in app
.
I've also tried query.toggle()
but no luck.