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 modal.tsx

Steven Teyd07c9520d82d
diff --git a/components/shared/modal.tsx b/components/shared/modal.tsx
index 62ff466e04..f4e3222e0b 100644
--- a/components/shared/modal.tsx
+++ b/components/shared/modal.tsx
@@ -77,7 +77,15 @@ export default function Modal({
return (
<AnimatePresence>
{showModal && (
- <FocusTrap focusTrapOptions={{ initialFocus: false }}>
+ <FocusTrap
+ focusTrapOptions={{
+ initialFocus: false,
+ onActivate: () => {
+ // prevent scroll outside of modal
+ document.body.style.overflow = "hidden";
+ },
+ }}
+ >
<div className="absolute">
<motion.div
ref={mobileModalRef}