fix: cannot click dropdown appearance (#4750)

This commit is contained in:
Faisal Amir 2025-02-27 11:28:07 +07:00 committed by GitHub
parent 6a0fb09610
commit aa26e45c22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -11,10 +11,13 @@ type Props = {
open?: boolean
block?: boolean
value?: string
side?: 'top' | 'right' | 'bottom' | 'left'
position?: 'item-aligned' | 'popper'
placeholder?: string
disabled?: boolean
containerPortal?: HTMLDivElement | undefined | null
className?: string
sideOffset?: number
onValueChange?: (value: string) => void
onOpenChange?: (open: boolean) => void
}
@ -26,7 +29,10 @@ const Select = ({
disabled,
containerPortal,
block,
sideOffset,
position,
className,
side,
open,
onValueChange,
onOpenChange,
@ -52,7 +58,12 @@ const Select = ({
</SelectPrimitive.Trigger>
<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">
{options &&
options.map((item, i) => {
@ -79,7 +90,6 @@ const Select = ({
)
})}
</SelectPrimitive.Viewport>
<SelectPrimitive.Arrow />
</SelectPrimitive.Content>
</SelectPrimitive.Portal>
</SelectPrimitive.Root>

View File

@ -84,6 +84,8 @@ export default function AppearanceOptions() {
</p>
</div>
<Select
position="popper"
sideOffset={4}
value={selectedIdTheme}
options={themeOptions}
onValueChange={(e) => handleClickTheme(e)}