Add ability to force picker width (#1093)

This commit is contained in:
Charles Bochet
2023-08-05 15:41:18 -07:00
committed by GitHub
parent 35395c2e67
commit 14f9e892d1
7 changed files with 28 additions and 7 deletions

View File

@ -30,6 +30,7 @@ export function SingleEntitySelect<
onEntitySelected,
onCreate,
onCancel,
width,
disableBackgroundBlur = false,
}: {
onCancel?: () => void;
@ -37,6 +38,7 @@ export function SingleEntitySelect<
entities: EntitiesForSingleEntitySelect<CustomEntityForSelect>;
onEntitySelected: (entity: CustomEntityForSelect | null | undefined) => void;
disableBackgroundBlur?: boolean;
width?: number;
}) {
const containerRef = useRef<HTMLDivElement>(null);
@ -58,7 +60,11 @@ export function SingleEntitySelect<
});
return (
<DropdownMenu disableBlur={disableBackgroundBlur} ref={containerRef}>
<DropdownMenu
disableBlur={disableBackgroundBlur}
ref={containerRef}
width={width}
>
<DropdownMenuSearch
value={searchFilter}
onChange={handleSearchFilterChange}