fix(web): ensure relative modal respects scrollY

This commit is contained in:
Paul Armstrong
2021-02-07 11:54:30 -06:00
committed by Blake Blackshear
parent 15c64e5770
commit 4e02d795b4
+1 -1
View File
@@ -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();