Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update is-click-on-interactive-child.ts

Tim Wilsond39eb82f1f95
diff --git a/packages/utils/src/functions/is-click-on-interactive-child.ts b/packages/utils/src/functions/is-click-on-interactive-child.ts
index 38dc7836c5..65c26e8364 100644
--- a/packages/utils/src/functions/is-click-on-interactive-child.ts
+++ b/packages/utils/src/functions/is-click-on-interactive-child.ts
@@ -1,3 +1,5 @@
+import { MouseEvent } from "react";
+
export function isClickOnInteractiveChild(e: MouseEvent) {
// Traverse up the DOM tree to see if there's a clickable element between this card and the click
for (
@@ -10,7 +12,11 @@ export function isClickOnInteractiveChild(e: MouseEvent) {
["button", "a", "input", "textarea"].includes(
target.tagName.toLowerCase(),
) ||
- target.getAttribute("data-radix-popper-content-wrapper") !== null
+ [
+ "data-radix-popper-content-wrapper",
+ "data-vaul-overlay",
+ "data-vaul-drawer",
+ ].some((attr) => target.getAttribute(attr) !== null)
)
return true;
}