Skip to content

Commit

Permalink
feat: add dropdwonWidth prop to select
Browse files Browse the repository at this point in the history
  • Loading branch information
lialila committed Jan 16, 2025
1 parent 2502587 commit e716e69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/BoemlyFormControl/BoemlyFormControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export interface BoemlyFormControlProps extends StyleProps {
isInvalid?: boolean;
isReadOnly?: boolean;
isDisabled?: boolean;

dropdownWidth?: 'xs' | 'sm' | 'md' | 'lg';
}

export const BoemlyFormControl: React.FC<BoemlyFormControlProps> = ({
Expand Down Expand Up @@ -91,6 +93,8 @@ export const BoemlyFormControl: React.FC<BoemlyFormControlProps> = ({
isReadOnly = false,
isDisabled = false,

dropdownWidth,

...styleProps
}: BoemlyFormControlProps) => {
const [isMobile] = useMediaQuery(BREAKPOINT_MD_QUERY);
Expand Down Expand Up @@ -118,6 +122,7 @@ export const BoemlyFormControl: React.FC<BoemlyFormControlProps> = ({
bgColor="white"
{...{ isDisabled, isInvalid, ...selectProps }}
options={selectOptions}
dropdownWidth={dropdownWidth}
/>
);
case 'Checkbox':
Expand Down
3 changes: 3 additions & 0 deletions src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface BoemlySelectProps extends Omit<SelectProps, 'onChange' | 'value
selectAllText?: string;
value?: string[];
size?: 'xs' | 'sm' | 'md' | 'lg';
dropdownWidth?: 'xs' | 'sm' | 'md' | 'lg';
variant?: 'filled' | 'unstyled' | 'flushed' | 'outline';
onChange?: (value: string[]) => void;
onClose?: () => void;
Expand All @@ -64,6 +65,7 @@ export const BoemlySelect: React.FC<BoemlySelectProps> = ({
preventDeselection = false,
selectAllText = 'Select All',
size = 'md',
dropdownWidth,
variant = 'outline',
borderColor = CustomizedSelect.variants[variant].borderColor,
backgroundColor = CustomizedSelect.variants[variant].backgroundColor,
Expand Down Expand Up @@ -259,6 +261,7 @@ export const BoemlySelect: React.FC<BoemlySelectProps> = ({
maxHeight={dynamicMaxHeight}
overflowY="auto"
zIndex="popover"
width={dropdownWidth}
>
{isSearchable && (
<InputGroup mb="4">
Expand Down

0 comments on commit e716e69

Please sign in to comment.