Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select: allow setting a z-index of the content popover #507

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading