Skip to content

Commit

Permalink
fix:dropdown-menu mdx diff display
Browse files Browse the repository at this point in the history
  • Loading branch information
terrence-ou committed Nov 24, 2024
1 parent 805ed41 commit 1517f6a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions apps/www/content/docs/components/dropdown-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ const DropdownMenuItem = React.forwardRef<
>(({ className, inset, ...props }, ref) => (
<DropdownMenuPrimitive.Item
ref={ref}
className={cn(
"relative ... gap-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
className={cn(
+ "relative ... gap-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
inset && "pl-8",
className
)}
Expand All @@ -125,18 +125,17 @@ const DropdownMenuItem = React.forwardRef<

Added `gap-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0` to the `<DropdownMenuSubTrigger />` to automatically style icon inside.

Add the following classes to the `cva` call in your `dropdown-menu.tsx` file.
Add the following classes to the `cn` call in your `dropdown-menu.tsx` file.

```tsx title="dropdown-menu.tsx"
```diff title="dropdown-menu.tsx"
<DropdownMenuPrimitive.SubTrigger
ref={ref}
className={cn(
"flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
inset && "pl-8",
className
)}
{...props}
>
{...props}>
{/* ... */}
</DropdownMenuPrimitive.SubTrigger>
```

0 comments on commit 1517f6a

Please sign in to comment.