Skip to content

Commit 3d76873

Browse files
committed
style: enhance command palette interaction and styles
- Updated command palette styles to ensure mouse selection works effectively. - Added pointer events to command list and items for improved user interaction. - Refined styles for better clarity and responsiveness in the command menu component.
1 parent b6e13c4 commit 3d76873

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

packages/docs/app/globals.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,16 @@
272272
@apply block;
273273
}
274274

275-
/* Hide scrollbar for command palette */
275+
/* Command palette - ensure mouse selection works */
276276
[cmdk-list] {
277277
overflow: auto;
278278
overscroll-behavior: contain;
279+
pointer-events: auto;
280+
}
281+
282+
[cmdk-item] {
283+
pointer-events: auto;
284+
cursor: pointer;
279285
}
280286

281287
[cmdk-list]::-webkit-scrollbar {

packages/docs/components/command-menu.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function CommandMenu() {
7171
/>
7272

7373
{/* Dialog - above header (z-50) and mobile TOC (z-[60]) */}
74-
<div className="fixed left-[50%] top-[20%] z-[201] w-full max-w-lg translate-x-[-50%] p-4">
74+
<div className="fixed left-[50%] top-[20%] z-[201] w-full max-w-lg translate-x-[-50%] p-4 pointer-events-auto">
7575
<Command className={cn(
7676
'relative rounded-2xl overflow-hidden',
7777
'bg-zinc-900/95 dark:bg-zinc-900 border border-zinc-700',
@@ -86,7 +86,7 @@ export function CommandMenu() {
8686
/>
8787
</div>
8888

89-
<Command.List className="max-h-[320px] overflow-y-auto p-2 bg-zinc-900">
89+
<Command.List className="max-h-[320px] overflow-y-auto p-2 bg-zinc-900 pointer-events-auto">
9090
<Command.Empty className="py-8 text-center text-sm text-zinc-500">
9191
No results found.
9292
</Command.Empty>
@@ -100,8 +100,9 @@ export function CommandMenu() {
100100
key={page.href}
101101
value={page.title}
102102
onSelect={() => runCommand(() => router.push(page.href))}
103+
onClick={() => runCommand(() => router.push(page.href))}
103104
className={cn(
104-
'relative flex cursor-pointer select-none items-center rounded-lg px-3 py-2.5 text-sm outline-none',
105+
'relative flex cursor-pointer select-none items-center rounded-lg px-3 py-2.5 text-sm outline-none pointer-events-auto',
105106
'transition-all duration-150',
106107
'text-zinc-300',
107108
'aria-selected:bg-violet-600/20 aria-selected:text-white',

0 commit comments

Comments
 (0)