fix: cannot click dropdown appearance (#4750)
This commit is contained in:
parent
6a0fb09610
commit
aa26e45c22
@ -11,10 +11,13 @@ type Props = {
|
|||||||
open?: boolean
|
open?: boolean
|
||||||
block?: boolean
|
block?: boolean
|
||||||
value?: string
|
value?: string
|
||||||
|
side?: 'top' | 'right' | 'bottom' | 'left'
|
||||||
|
position?: 'item-aligned' | 'popper'
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
containerPortal?: HTMLDivElement | undefined | null
|
containerPortal?: HTMLDivElement | undefined | null
|
||||||
className?: string
|
className?: string
|
||||||
|
sideOffset?: number
|
||||||
onValueChange?: (value: string) => void
|
onValueChange?: (value: string) => void
|
||||||
onOpenChange?: (open: boolean) => void
|
onOpenChange?: (open: boolean) => void
|
||||||
}
|
}
|
||||||
@ -26,7 +29,10 @@ const Select = ({
|
|||||||
disabled,
|
disabled,
|
||||||
containerPortal,
|
containerPortal,
|
||||||
block,
|
block,
|
||||||
|
sideOffset,
|
||||||
|
position,
|
||||||
className,
|
className,
|
||||||
|
side,
|
||||||
open,
|
open,
|
||||||
onValueChange,
|
onValueChange,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
@ -52,7 +58,12 @@ const Select = ({
|
|||||||
</SelectPrimitive.Trigger>
|
</SelectPrimitive.Trigger>
|
||||||
|
|
||||||
<SelectPrimitive.Portal container={containerPortal}>
|
<SelectPrimitive.Portal container={containerPortal}>
|
||||||
<SelectPrimitive.Content className="select__content">
|
<SelectPrimitive.Content
|
||||||
|
side={side}
|
||||||
|
position={position}
|
||||||
|
sideOffset={sideOffset}
|
||||||
|
className="select__content"
|
||||||
|
>
|
||||||
<SelectPrimitive.Viewport className="select__viewport">
|
<SelectPrimitive.Viewport className="select__viewport">
|
||||||
{options &&
|
{options &&
|
||||||
options.map((item, i) => {
|
options.map((item, i) => {
|
||||||
@ -79,7 +90,6 @@ const Select = ({
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</SelectPrimitive.Viewport>
|
</SelectPrimitive.Viewport>
|
||||||
<SelectPrimitive.Arrow />
|
|
||||||
</SelectPrimitive.Content>
|
</SelectPrimitive.Content>
|
||||||
</SelectPrimitive.Portal>
|
</SelectPrimitive.Portal>
|
||||||
</SelectPrimitive.Root>
|
</SelectPrimitive.Root>
|
||||||
|
|||||||
@ -84,6 +84,8 @@ export default function AppearanceOptions() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Select
|
<Select
|
||||||
|
position="popper"
|
||||||
|
sideOffset={4}
|
||||||
value={selectedIdTheme}
|
value={selectedIdTheme}
|
||||||
options={themeOptions}
|
options={themeOptions}
|
||||||
onValueChange={(e) => handleClickTheme(e)}
|
onValueChange={(e) => handleClickTheme(e)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user