feat: add support for custom menu properties in Dropdown component

This commit is contained in:
Hossein Mehrabi 2023-10-23 10:26:04 +03:30
parent 07fb14ae8e
commit 65bebb8326
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1
1 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,7 @@ import {
} from '../../utils/useCommonProps'
import { SelectOption, useSelect } from '../../utils/useSelect'
import { DropdownItem } from '../DropdownItem'
import { DropdownMenu } from '../DropdownMenu'
import { DropdownMenu, DropdownMenuProps } from '../DropdownMenu'
import { ChevronDownIcon, ChevronUpIcon, ErrorIcon } from '../Icons'
import { Portal } from '../PortalProvider/Portal'
import { Typography } from '../Typography'
@ -34,6 +34,8 @@ export type DropdownProps = CommonProps &
variant?: 'outlined' | 'underlined'
isOpen?: boolean
onToggle?: (open: boolean) => void
menuProps?: Partial<DropdownMenuProps>
}
export const Dropdown: React.FC<DropdownProps> & {
@ -52,6 +54,7 @@ export const Dropdown: React.FC<DropdownProps> & {
variant = 'outlined',
isOpen,
onToggle,
menuProps = {},
...props
}) => {
const commonProps = useCommonProps(props)
@ -168,6 +171,7 @@ export const Dropdown: React.FC<DropdownProps> & {
onClose={() => handleToggle(false)}
size={size}
genericFontFamily={props.genericFontFamily}
{...menuProps}
>
{options.map((opt) => (
<DropdownItem