mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 02:35:22 +03:00
remove top from the equations due to scroll height
This commit is contained in:
parent
0bf0c0ea07
commit
cbb99f70e4
@ -89,7 +89,13 @@ export default function RelativeModal({
|
|||||||
newTop = WINDOW_PADDING;
|
newTop = WINDOW_PADDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxHeight = windowHeight - WINDOW_PADDING * 2 > menuHeight ? null : windowHeight - WINDOW_PADDING * 2;
|
// This calculation checks if there's enough space to display the menu.
|
||||||
|
// If there is, it sets the maxHeight to null(meaning no height constraint). If not, it calculates the maxHeight based on the remaining space in the window
|
||||||
|
const maxHeight =
|
||||||
|
windowHeight - WINDOW_PADDING * 2 > menuHeight
|
||||||
|
? null
|
||||||
|
: windowHeight - WINDOW_PADDING * 2 - top + window.scrollY;
|
||||||
|
|
||||||
const newPosition = { left: newLeft, top: newTop, maxHeight };
|
const newPosition = { left: newLeft, top: newTop, maxHeight };
|
||||||
if (widthRelative) {
|
if (widthRelative) {
|
||||||
newPosition.width = relativeToWidth;
|
newPosition.width = relativeToWidth;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user