From 3f31a115c91927dee93bfc7c1001a0b3af6d6b4e Mon Sep 17 00:00:00 2001 From: Steven RYDELL Date: Wed, 29 Jul 2026 07:34:48 +0200 Subject: [PATCH] Show an ESC hint instead of the close button in the command palette --- src/components/ui/command.tsx | 5 ++++- src/components/ui/dialog.tsx | 16 ++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsx index b0c2d4b..f89b480 100644 --- a/src/components/ui/command.tsx +++ b/src/components/ui/command.tsx @@ -31,7 +31,7 @@ Command.displayName = CommandPrimitive.displayName; const CommandDialog = ({ children, ...props }: DialogProps) => { return ( - + {children} @@ -54,6 +54,9 @@ const CommandInput = React.forwardRef< )} {...props} /> + + ESC + )); CommandInput.displayName = CommandPrimitive.Input.displayName; diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx index 43e6d83..1be8428 100644 --- a/src/components/ui/dialog.tsx +++ b/src/components/ui/dialog.tsx @@ -35,8 +35,10 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< React.ComponentRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( + React.ComponentPropsWithoutRef & { + showCloseButton?: boolean; + } +>(({ className, children, showCloseButton = true, ...props }, ref) => ( {children} - - - Close - + {showCloseButton && ( + + + Close + + )} ));