Skip to content

Commit

Permalink
fix: value escaping in CommandItem component (#10)
Browse files Browse the repository at this point in the history
Revert this when there is a patch update from `cmdk`
  • Loading branch information
fityannugroho authored Feb 11, 2024
1 parent 4a5380c commit 48c6fa8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/ui/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ CommandSeparator.displayName = CommandPrimitive.Separator.displayName
const CommandItem = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
>(({ className, value, ...props }, ref) => (
<CommandPrimitive.Item
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className,
)}
value={value?.replaceAll('"', '\\"')}
{...props}
/>
))
Expand Down

0 comments on commit 48c6fa8

Please sign in to comment.