fix(Select): remove Icon asChild from Trigger to avoid Slot error
- Radix SelectTrigger composes its children via Slot internally
- Having both {children} and <Icon asChild> caused "Slot failed to slot onto its children"
- Use Radix default Icon instead (rendered automatically)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react'
|
||||
import * as SelectPrimitive from '@radix-ui/react-select'
|
||||
import { ChevronDown, Check } from 'lucide-react'
|
||||
import { Check } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const Select = SelectPrimitive.Root
|
||||
@@ -23,9 +23,6 @@ const SelectTrigger = React.forwardRef<
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
<SelectPrimitive.Icon asChild>
|
||||
<ChevronDown className="h-4 w-4 text-fg-subtle" />
|
||||
</SelectPrimitive.Icon>
|
||||
</SelectPrimitive.Trigger>
|
||||
))
|
||||
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
||||
|
||||
Reference in New Issue
Block a user