diff --git a/app/src/atoms/MenuList/DropdownMenu.tsx b/app/src/atoms/MenuList/DropdownMenu.tsx index 45fb1ddd251..c2dd1ed9c3d 100644 --- a/app/src/atoms/MenuList/DropdownMenu.tsx +++ b/app/src/atoms/MenuList/DropdownMenu.tsx @@ -74,7 +74,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element { const dropdownRect = dropDownMenuWrapperRef.current?.getBoundingClientRect() if (dropdownRect != null) { const parentElement = dropDownMenuWrapperRef?.current?.parentElement - const grandParentElement = parentElement?.parentElement + const grandParentElement = parentElement?.parentElement?.parentElement let availableHeight = window.innerHeight let scrollOffset = 0 @@ -91,12 +91,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element { const dropdownBottom = dropdownRect.bottom + (filterOptions.length + 1) * 34 - scrollOffset - setDropdownPosition( - dropdownBottom > availableHeight && - window.innerHeight < availableHeight - ? 'top' - : 'bottom' - ) + setDropdownPosition(dropdownBottom > availableHeight ? 'top' : 'bottom') } }