From c9cd810c9f81be77efd0d4ffe121ce8ff9cd5a6b Mon Sep 17 00:00:00 2001 From: Bernt Christian Egeland Date: Thu, 16 Feb 2023 12:47:18 -0100 Subject: [PATCH] reposition the modal when close to bottom (#5507) --- web/src/components/RelativeModal.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/components/RelativeModal.jsx b/web/src/components/RelativeModal.jsx index ab6907a2b..93ebe2a26 100644 --- a/web/src/components/RelativeModal.jsx +++ b/web/src/components/RelativeModal.jsx @@ -80,7 +80,9 @@ export default function RelativeModal({ // too close to bottom if (top + menuHeight > windowHeight - WINDOW_PADDING + window.scrollY) { - newTop = WINDOW_PADDING; + // If the pop-up modal would extend beyond the bottom of the visible window, + // reposition the modal to appear above the clicked icon instead + newTop = top - menuHeight; } if (top <= WINDOW_PADDING + window.scrollY) {