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 Teyda52f0c9c584
diff --git a/components/shared/modal.tsx b/components/shared/modal.tsx
index f4e3222e0b..2f617d3d5b 100644
--- a/components/shared/modal.tsx
+++ b/components/shared/modal.tsx
@@ -81,9 +81,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">