Bläddra i källkod

fix(web): ensure relative modal respects scrollY

Paul Armstrong 4 år sedan
förälder
incheckning
b422a83b57
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      web/src/components/RelativeModal.jsx

+ 1 - 1
web/src/components/RelativeModal.jsx

@@ -59,7 +59,7 @@ export default function RelativeModal({ className, role = 'dialog', children, on
       if (top + menuHeight > windowHeight - WINDOW_PADDING) {
         top = y - menuHeight;
       }
-      setPosition({ left, top, width });
+      setPosition({ left, top: top + window.scrollY, width });
       const focusable = ref.current.querySelector('[tabindex]');
       focusable && console.log('focusing');
       focusable && focusable.focus();