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": [ 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 }