Skip to content

Commit 178c900

Browse files
committed
Simplify vertical overflow handling in DropdownMenu positioning
1 parent 942c050 commit 178c900

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎packages/ui/src/components/editor/common/DropdownMenu/DropdownMenu.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ export const DropdownMenu: React.FC<DropdownMenu.Props> = (props) => {
5656
}
5757

5858
const viewport_height = window.innerHeight
59-
if (top + dropdown_rect.height > viewport_height - 4) {
60-
const overflow = top + dropdown_rect.height - (viewport_height - 4)
61-
top -= overflow
59+
if (top + dropdown_rect.height > viewport_height) {
60+
top = viewport_height - dropdown_rect.height
6261
}
6362

6463
set_anchor_style({

0 commit comments

Comments
 (0)