A drawer component for React.
fix: make modal false scrollable (#444)
Emil Kowalskib8be89625d13
diff --git a/src/index.tsx b/src/index.tsxindex d820a27..1aa63dd 100644--- a/src/index.tsx+++ b/src/index.tsx@@ -694,6 +694,9 @@ export const Overlay = React.forwardRef<HTMLDivElement, React.ComponentPropsWithconst composedRef = useComposedRefs(ref, overlayRef);const hasSnapPoints = snapPoints && snapPoints.length > 0;+ // Overlay is the component that is locking scroll, removing it will unlock the scroll without having to dig into Radix's Dialog library+ if (!modal) return null;+return (<DialogPrimitive.OverlayonMouseUp={onRelease}@@ -701,7 +704,6 @@ export const Overlay = React.forwardRef<HTMLDivElement, React.ComponentPropsWithdata-vaul-overlay=""data-vaul-snap-points={isOpen && hasSnapPoints ? 'true' : 'false'}data-vaul-snap-points-overlay={isOpen && shouldFade ? 'true' : 'false'}- style={{ visibility: modal ? 'visible' : 'hidden' }}{...rest}/>);