mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-06-01 22:50:35 +00:00
fix: popover aschild recursive loop
This commit is contained in:
parent
9509286f3e
commit
34cad7df41
1 changed files with 17 additions and 0 deletions
|
|
@ -103,11 +103,28 @@ const PopoverTrigger = React.forwardRef<
|
|||
disabled,
|
||||
showChevron = true,
|
||||
leadingIcon,
|
||||
asChild,
|
||||
...props
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
const stateCls = resolveStateClasses(state, Boolean(disabled));
|
||||
|
||||
// When asChild is used, we need to ensure only a single child is passed
|
||||
// The custom wrapper UI (title, note, chevron) is incompatible with asChild
|
||||
if (asChild) {
|
||||
return (
|
||||
<PopoverPrimitive.Trigger
|
||||
ref={ref}
|
||||
disabled={disabled}
|
||||
asChild
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</PopoverPrimitive.Trigger>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cn('w-full', stateCls.wrapper)}>
|
||||
{title ? (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue