fix: react-select overflow issue in some modals. (#6587)

* feat: add a disable overflow prop

* feat: use the disable overflow prop
pull/6596/head
Nafees Nazik 2023-01-20 18:59:37 +05:30 committed by GitHub
parent fbc27e1d52
commit 00cab5c41f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -212,7 +212,7 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
return (
<Dialog open={isOpenDialog}>
<DialogContent>
<DialogContent disableOverflow>
<div className="flex flex-row space-x-3">
<div className="bg-secondary-100 mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full sm:mx-0 sm:h-10 sm:w-10">
<Icon.FiMapPin className="text-primary-600 h-6 w-6" />

View File

@ -67,7 +67,7 @@ export default function MemberChangeRoleModal(props: {
}
return (
<Dialog open={props.isOpen} onOpenChange={props.onExit}>
<DialogContent type="creation">
<DialogContent disableOverflow type="creation">
<>
<div className="mb-4 sm:flex sm:items-start">
<div className="text-center sm:text-left">

View File

@ -68,10 +68,11 @@ type DialogContentProps = React.ComponentProps<typeof DialogPrimitive["Content"]
closeText?: string;
actionDisabled?: boolean;
Icon?: SVGComponent;
disableOverflow?: boolean;
};
export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps>(
({ children, title, Icon, type = "creation", ...props }, forwardedRef) => {
({ children, title, Icon, disableOverflow, type = "creation", ...props }, forwardedRef) => {
return (
<DialogPrimitive.Portal>
<DialogPrimitive.Overlay className="fadeIn fixed inset-0 z-40 bg-gray-500 bg-opacity-75 transition-opacity" />
@ -87,7 +88,8 @@ export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps
: props.size == "md"
? "p-8 sm:max-w-[48rem]"
: "p-8 sm:max-w-[35rem]",
"max-h-[95vh] overflow-auto",
"max-h-[95vh]",
disableOverflow ? "overflow-visible" : "overflow-auto",
`${props.className || ""}`
)}
ref={forwardedRef}>