fix: add allowScroll prop (#6215)

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
pull/6219/head
Udit Takkar 2022-12-30 23:46:37 +05:30 committed by GitHub
parent 3535a25a59
commit 518a4484d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -182,7 +182,7 @@ const DateOverrideInputDialog = ({
return ( return (
<Dialog open={open} onOpenChange={setOpen}> <Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>{Trigger}</DialogTrigger> <DialogTrigger asChild>{Trigger}</DialogTrigger>
<DialogContent size="md"> <DialogContent allowScroll={true} size="md">
<DateOverrideForm <DateOverrideForm
excludedDates={excludedDates} excludedDates={excludedDates}
{...passThroughProps} {...passThroughProps}

View File

@ -59,6 +59,7 @@ type DialogContentProps = React.ComponentProps<typeof DialogPrimitive["Content"]
closeText?: string; closeText?: string;
actionDisabled?: boolean; actionDisabled?: boolean;
Icon?: SVGComponent; Icon?: SVGComponent;
allowScroll?: boolean;
}; };
export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps>( export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps>(
@ -78,7 +79,8 @@ export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps
: props.size == "md" : props.size == "md"
? "p-8 sm:max-w-[48rem]" ? "p-8 sm:max-w-[48rem]"
: "p-8 sm:max-w-[35rem]", : "p-8 sm:max-w-[35rem]",
"overflow-y-auto overscroll-auto md:h-auto md:max-h-[inherit]", "max-h-[560px] overscroll-auto md:h-auto md:max-h-[inherit]",
props.allowScroll ? "overflow-y-auto" : "overflow-visible",
`${props.className || ""}` `${props.className || ""}`
)} )}
ref={forwardedRef}> ref={forwardedRef}>