Skip to content

Commit 0c9c2f4

Browse files
authored
feat: close command palette with the same shortcut (#443)
- Close command palette with the same shortcut - Add scroll bottom/top padding for nicer arrow-scroll experience also closes EN-652
1 parent a981ce3 commit 0c9c2f4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/features/dashboard/sidebar/command.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export default function DashboardSidebarCommand({
3838
useKeydown((event) => {
3939
if (event.key === 'k' && (event.metaKey || event.ctrlKey)) {
4040
event.preventDefault()
41-
event.stopPropagation()
42-
setOpen(true)
41+
setOpen((prev) => !prev)
4342
}
4443

4544
return true
@@ -72,7 +71,7 @@ export default function DashboardSidebarCommand({
7271
</SidebarMenuItem>
7372
<CommandDialog open={open} onOpenChange={setOpen}>
7473
<CommandInput placeholder="Quick Jump to..." />
75-
<CommandList className="p-1 pb-3">
74+
<CommandList className="scroll-py-3 px-1 py-3">
7675
<CommandEmpty>No results found.</CommandEmpty>
7776
<CommandGroup heading="Pages">
7877
{SIDEBAR_ALL_LINKS.map((link) => (

0 commit comments

Comments
 (0)