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.

use <dialog> for desktop modal (h/t to @agadzik for the recommendation)

Steven Teyb0f19756cb66
diff --git a/components/shared/modal.tsx b/components/shared/modal.tsx
index c4098c214b..08c1f99d8d 100644
--- a/components/shared/modal.tsx
+++ b/components/shared/modal.tsx
@@ -90,10 +90,10 @@ export default function Modal({
</div>
{children}
</motion.div>
- <motion.div
+ <motion.dialog
ref={desktopModalRef}
key="desktop-modal"
- className="fixed inset-0 z-40 min-h-screen hidden sm:flex items-center justify-center"
+ className="fixed inset-0 z-40 hidden sm:block bg-transparent"
initial={{ scale: 0.95 }}
animate={{ scale: 1 }}
exit={{ scale: 0.95 }}
@@ -102,7 +102,7 @@ export default function Modal({
}}
>
{children}
- </motion.div>
+ </motion.dialog>
<motion.div
key="backdrop"
className="fixed inset-0 z-30 bg-gray-100 bg-opacity-10 backdrop-blur"