From 654ecdd4accab0c49738d68c9f3d7a59d8250370 Mon Sep 17 00:00:00 2001 From: Jacek Kolasa Date: Thu, 23 Mar 2023 20:29:55 +0100 Subject: [PATCH 1/2] if align=="top", but there is not enough space, switch to align="bottom" --- src/components/drops/drop/useMakeUpdatePosition.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/drops/drop/useMakeUpdatePosition.js b/src/components/drops/drop/useMakeUpdatePosition.js index b8fab00e8..c8f9362a2 100644 --- a/src/components/drops/drop/useMakeUpdatePosition.js +++ b/src/components/drops/drop/useMakeUpdatePosition.js @@ -32,7 +32,13 @@ const getAbsoluteYPosition = (align, targetRect, dropRect) => { if (align.top === "top") return targetRect.top if (align.top === "bottom") return targetRect.bottom if (align.bottom === "bottom") return targetRect.bottom - dropRect.height - if (align.bottom === "top") return targetRect.top - dropRect.height + if (align.bottom === "top") { + const y = targetRect.top - dropRect.height + if (y < 0 && targetRect.bottom + dropRect.height < window.innerHeight) { + return targetRect.bottom + } + return y + } return targetRect.top + targetRect.height / 2 - dropRect.height / 2 } From 73682ec258a654651685876a439995525f94a42d Mon Sep 17 00:00:00 2001 From: Jacek Kolasa Date: Fri, 24 Mar 2023 17:50:34 +0100 Subject: [PATCH 2/2] v2.13.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 723dd7b3e..fb2612831 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netdata/netdata-ui", - "version": "2.13.2", + "version": "2.13.3", "description": "netdata UI kit", "main": "./lib/index.js", "files": [