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.

fix: fis desktop modal not being clickable

Snazzahc8112cca8a3a
diff --git a/components/shared/modal.tsx b/components/shared/modal.tsx
index 41ecf7df3b..b28a0e3c96 100644
--- a/components/shared/modal.tsx
+++ b/components/shared/modal.tsx
@@ -22,6 +22,7 @@ export default function Modal({
const router = useRouter();
const { key } = router.query;
const mobileModalRef = useRef(null);
+ const desktopModalRef = useRef(null);
const closeModal = useCallback(() => {
if (key) {
@@ -90,12 +91,15 @@ export default function Modal({
{children}
</motion.div>
<motion.div
+ ref={desktopModalRef}
key="desktop-modal"
- className="fixed inset-0 z-40 min-h-screen px-4 hidden sm:flex items-center justify-center"
+ className="fixed inset-0 z-50 min-h-screen px-4 hidden sm:flex items-center justify-center"
initial={{ scale: 0.95 }}
animate={{ scale: 1 }}
exit={{ scale: 0.95 }}
- onClick={closeModal}
+ onClick={(e) => {
+ if (desktopModalRef.current === e.target) closeModal();
+ }}
>
{children}
</motion.div>