Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

Fix modal prop (#109)

Emil Kowalski95c3f96b1a8d
diff --git a/src/index.tsx b/src/index.tsx
index 3469cb1..345ce20 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -668,6 +668,7 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(function (
setVisible,
closeDrawer,
scaleBackground,
+ modal,
} = useDrawerContext();
const composedRef = useComposedRefs(ref, drawerRef);
@@ -688,6 +689,10 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(function (
}}
onPointerDown={onPress}
onPointerDownOutside={(e) => {
+ if (!modal) {
+ e.preventDefault();
+ return;
+ }
if (keyboardIsOpen.current) {
keyboardIsOpen.current = false;
}