Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

Handle multi touch (#137)

Emil Kowalski9e15038d7134
diff --git a/src/index.tsx b/src/index.tsx
index 4a24f0c..ae3aa01 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -124,7 +124,7 @@ function Root({
}
function onPress(event: React.PointerEvent<HTMLDivElement>) {
- if (!dismissible && !snapPoints) return;
+ if ((!dismissible && !snapPoints) || isDragging) return;
if (drawerRef.current && !drawerRef.current.contains(event.target as Node)) return;
drawerHeightRef.current = drawerRef.current?.getBoundingClientRect().height || 0;
setIsDragging(true);