From 776e73c9ea7b7ab574dc1feb39b3c36171c21bad Mon Sep 17 00:00:00 2001 From: Bernt Christian Egeland Date: Wed, 15 Feb 2023 20:48:04 +0100 Subject: [PATCH] reposition the modal when close to bottom --- 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) {