Skip to content

Commit

Permalink
Merge pull request #184 from ynput/develop
Browse files Browse the repository at this point in the history
Release: fix(dropdown): widthExpandMax
  • Loading branch information
Innders authored Sep 16, 2024
2 parents ec7083c + a5a1207 commit f248402
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Dropdowns/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>
itemClassName?: string
valueClassName?: string
listClassName?: string
widthExpand?: boolean
widthExpand?: boolean // expand to width of button
widthExpandMax?: boolean // does not expand past button width
searchFields?: string[]
minSelected?: number
maxSelected?: number
Expand Down Expand Up @@ -144,6 +145,7 @@ export const Dropdown = forwardRef<DropdownRef, DropdownProps>(
onAddItem,
onOpen,
widthExpand = true,
widthExpandMax = false,
align = 'left',
multiSelect,
multiSelectClose = false,
Expand Down Expand Up @@ -925,7 +927,7 @@ export const Dropdown = forwardRef<DropdownRef, DropdownProps>(
defer
>
<Styled.Options
style={{ minWidth, ...listStyle }}
style={{ minWidth, maxWidth: widthExpandMax ? minWidth : 'unset', ...listStyle }}
className={clsx('options', { usingKeyboard })}
ref={optionsRef}
>
Expand Down

0 comments on commit f248402

Please sign in to comment.