Skip to content

Commit

Permalink
Select: allow setting a z-index of the content popover
Browse files Browse the repository at this point in the history
  • Loading branch information
hoorayimhelping committed Dec 17, 2024
1 parent 34ee5df commit 4916620
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Select/common/InternalSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const InternalSelect = ({
container,
useFullWidthItems = false,
itemCharacterLimit = "64ch",
zIndex = "auto",
...props
}: SelectContainerProps) => {
const defaultId = useId();
Expand Down Expand Up @@ -391,6 +392,7 @@ export const InternalSelect = ({
align="start"
$useFullWidthItems={useFullWidthItems}
$itemCharacterLimit={itemCharacterLimit}
$zIndex={zIndex}
>
<SelectList>
<SearchBarContainer $showSearch={showSearch}>
Expand Down
3 changes: 3 additions & 0 deletions src/components/Select/common/SelectStyled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const StyledSelectTrigger = styled(Trigger)<{ $error: boolean }>`
export const SelectPopoverContent = styled(Content)<{
$useFullWidthItems: boolean;
$itemCharacterLimit?: string;
$zIndex?: string;
}>`
width: var(--radix-popover-trigger-width);
max-height: var(--radix-popover-content-available-height);
Expand Down Expand Up @@ -114,6 +115,8 @@ export const SelectPopoverContent = styled(Content)<{
padding: 0.5rem 0rem;
align-items: flex-start;
gap: 0.625rem;
z-index: ${({ $zIndex = "auto" }) => $zIndex};
`;

export const SearchBarContainer = styled.div<{ $showSearch: boolean }>`
Expand Down
1 change: 1 addition & 0 deletions src/components/Select/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ interface InternalSelectProps
container?: HTMLElement;
useFullWidthItems?: boolean;
itemCharacterLimit?: string;
zIndex?: string;
}

export type SelectOptionProp = SelectOptionType | SelectChildrenType;
Expand Down

0 comments on commit 4916620

Please sign in to comment.