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 Tey47f73b1a1719
diff --git a/app/ui/modal.tsx b/app/ui/modal.tsx
index 3ec197f759..ff7e39eb6b 100644
--- a/app/ui/modal.tsx
+++ b/app/ui/modal.tsx
@@ -84,9 +84,13 @@ export default function Modal({
focusTrapOptions={{
initialFocus: false,
onActivate: () => {
- // prevent scroll outside of modal
+ // prevent scroll outside of modal when modal is open
document.body.style.overflow = "hidden";
},
+ onDeactivate: () => {
+ // allow scroll outside of modal when modal is closed
+ document.body.style.overflow = "auto";
+ },
}}
>
<div className="absolute">