Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

fix: using e.preventDefault to prevent drawer from closing (#237)

Grant Clark264c56e4caa5
diff --git a/src/index.tsx b/src/index.tsx
index afa34ba..81cb9d8 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -793,7 +793,7 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(function (
onPointerDown={onPress}
onPointerDownOutside={(e) => {
onPointerDownOutside?.(e);
- if (!modal) {
+ if (!modal || e.defaultPrevented) {
e.preventDefault();
return;
}