reddit-moderator-toolbox icon indicating copy to clipboard operation
reddit-moderator-toolbox copied to clipboard

Keep popups contained within the viewport when opening

Open eritbh opened this issue 4 years ago • 1 comments

For most popups (e.g. modbutton) logic for positioning the popup works by setting its position to the location of the button that triggered it. When the button is near the edge of the screen, it can be positioned partially offscreen initially. In some contexts in new Reddit, the page can't be scrolled, so accessing the popup can be a bit annoying. We should try to keep the popups on-screen from the start.

eritbh avatar Jan 05 '21 04:01 eritbh

Ideally that would be the case however the logic can get complex certainly with bigger popups (and people with smaller windows/displays) you also don't want the popup header to fall outside the screen. I remember struggling with a very similar issue in the past.

creesch avatar Jan 05 '21 06:01 creesch