From b422a83b5750b1106832d2ae3379c4608be38967 Mon Sep 17 00:00:00 2001 From: Paul Armstrong Date: Thu, 4 Feb 2021 10:51:25 -0800 Subject: [PATCH] fix(web): ensure relative modal respects scrollY --- web/src/components/RelativeModal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/RelativeModal.jsx b/web/src/components/RelativeModal.jsx index 705db416b..5b7a41d8a 100644 --- a/web/src/components/RelativeModal.jsx +++ b/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();