* add `menuPlacement` react-select's props to `getReactSelectProps` to avoid dropdown overflow on small screen. By default, set to "auto".
This commit is contained in:
parent
6414903567
commit
1ba191c4ed
|
@ -7,6 +7,7 @@ import ReactSelect, {
|
||||||
SingleValue,
|
SingleValue,
|
||||||
MultiValue,
|
MultiValue,
|
||||||
SelectComponentsConfig,
|
SelectComponentsConfig,
|
||||||
|
MenuPlacement,
|
||||||
} from "react-select";
|
} from "react-select";
|
||||||
|
|
||||||
import classNames from "@calcom/lib/classNames";
|
import classNames from "@calcom/lib/classNames";
|
||||||
|
@ -37,10 +38,13 @@ export const getReactSelectProps = <
|
||||||
>({
|
>({
|
||||||
className,
|
className,
|
||||||
components,
|
components,
|
||||||
|
menuPlacement = "auto",
|
||||||
}: {
|
}: {
|
||||||
className?: string;
|
className?: string;
|
||||||
components: SelectComponentsConfig<Option, IsMulti, Group>;
|
components: SelectComponentsConfig<Option, IsMulti, Group>;
|
||||||
|
menuPlacement?: MenuPlacement;
|
||||||
}) => ({
|
}) => ({
|
||||||
|
menuPlacement,
|
||||||
className: classNames("block h-[36px] w-full min-w-0 flex-1 rounded-md", className),
|
className: classNames("block h-[36px] w-full min-w-0 flex-1 rounded-md", className),
|
||||||
classNamePrefix: "cal-react-select",
|
classNamePrefix: "cal-react-select",
|
||||||
components: {
|
components: {
|
||||||
|
@ -69,7 +73,10 @@ export const Select = <
|
||||||
...props
|
...props
|
||||||
}: SelectProps<Option, IsMulti, Group>) => {
|
}: SelectProps<Option, IsMulti, Group>) => {
|
||||||
const reactSelectProps = React.useMemo(() => {
|
const reactSelectProps = React.useMemo(() => {
|
||||||
return getReactSelectProps<Option, IsMulti, Group>({ className, components: components || {} });
|
return getReactSelectProps<Option, IsMulti, Group>({
|
||||||
|
className,
|
||||||
|
components: components || {},
|
||||||
|
});
|
||||||
}, [className, components]);
|
}, [className, components]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user