Skip to content

Commit

Permalink
fix(web): ensure relative modal respects scrollY
Browse files Browse the repository at this point in the history
  • Loading branch information
paularmstrong authored and blakeblackshear committed Feb 20, 2021
1 parent 15ae3be commit b422a83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/components/RelativeModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b422a83

Please sign in to comment.