Add ability to force picker width (#1093)
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
export const DropdownMenu = styled.div<{ disableBlur?: boolean }>`
|
||||
export const DropdownMenu = styled.div<{
|
||||
disableBlur?: boolean;
|
||||
width?: number;
|
||||
}>`
|
||||
backdrop-filter: ${({ disableBlur }) =>
|
||||
disableBlur ? 'none' : 'blur(20px)'};
|
||||
|
||||
@ -13,7 +16,7 @@ export const DropdownMenu = styled.div<{ disableBlur?: boolean }>`
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
min-width: 160px;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
width: ${({ width }) => width ?? 160}px;
|
||||
`;
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -20,8 +20,6 @@ const StyledClickable = styled.div`
|
||||
`;
|
||||
|
||||
export function RawLink({ className, href, children, onClick }: OwnProps) {
|
||||
console.log(children);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<StyledClickable className={className}>
|
||||
|
||||
@ -54,6 +54,7 @@ export function GenericEditableRelationCellEditMode({ viewField }: OwnProps) {
|
||||
companyId={fieldValueEntity?.id ?? null}
|
||||
onSubmit={handleEntitySubmit}
|
||||
onCancel={handleCancel}
|
||||
width={viewField.columnSize}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -63,6 +64,7 @@ export function GenericEditableRelationCellEditMode({ viewField }: OwnProps) {
|
||||
userId={fieldValueEntity?.id ?? null}
|
||||
onSubmit={handleEntitySubmit}
|
||||
onCancel={handleCancel}
|
||||
width={viewField.columnSize}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user