diff --git a/src-web/components/core/Dropdown.tsx b/src-web/components/core/Dropdown.tsx index 2c5e6b67..ed2dc91b 100644 --- a/src-web/components/core/Dropdown.tsx +++ b/src-web/components/core/Dropdown.tsx @@ -350,8 +350,9 @@ const Menu = forwardRef, MenuPro container: CSSProperties; menu: CSSProperties; triangle: CSSProperties; + upsideDown: boolean; }>(() => { - if (triggerShape == null) return { container: {}, triangle: {}, menu: {} }; + if (triggerShape == null) return { container: {}, triangle: {}, menu: {}, upsideDown: false }; const menuMarginY = 5; const docRect = document.documentElement.getBoundingClientRect(); @@ -364,6 +365,7 @@ const Menu = forwardRef, MenuPro const upsideDown = heightBelow < heightAbove && heightBelow < items.length * 25 + 20 + 200; const triggerWidth = triggerShape.right - triggerShape.left; return { + upsideDown, container: { top: !upsideDown ? top + menuMarginY : undefined, bottom: upsideDown @@ -426,7 +428,7 @@ const Menu = forwardRef, MenuPro