Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed May 7, 2024
1 parent 586728e commit 0a95bab
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/src/atoms/MenuList/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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')
}
}

Expand Down

0 comments on commit 0a95bab

Please sign in to comment.