Skip to content

Commit e89e939

Browse files
committed
feat: Select z-index
1 parent b1d343d commit e89e939

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/Select.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export interface SelectProps<T extends SelectItemNode> {
9191
disableEllipsis?: boolean
9292
items?: T[]
9393
value?: string | null
94+
zIndex?: number
9495
onChange?: (value: T) => void
9596
render?: (value: T) => ReactNode
9697
ListItemProps?: Partial<PP<'div', ListItemProps>>
@@ -106,6 +107,7 @@ export const Select = forwardRefWithGenerics(
106107
disableEllipsis = false,
107108
items = [],
108109
value,
110+
zIndex,
109111
onChange,
110112
render = (e) => (typeof e === 'string' ? e : e.value),
111113
ListItemProps,
@@ -279,7 +281,10 @@ export const Select = forwardRefWithGenerics(
279281
<FloatingPortal>
280282
<AnimatePresence>
281283
{open && (
282-
<FloatingOverlay lockScroll={!touch} style={{ zIndex: 1 }}>
284+
<FloatingOverlay
285+
lockScroll={!touch}
286+
style={{ zIndex: typeof zIndex === 'number' ? zIndex : 1 }}
287+
>
283288
<FloatingFocusManager context={context}>
284289
<SelectItemsWrapper
285290
style={{

0 commit comments

Comments
 (0)