Skip to content

Commit 13530b1

Browse files
committed
Adjust dropdown vertical positioning to reserve a 6px bottom margin when not in modern UI, keeping existing behavior for modern UI
- should restore this change [Commit] but only for modern ui ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ └── components │ └── Layout │ └── Footer │ └── Footer.module.scss └── packages └── ui └── src └── components └── editor └── common └── DropdownMenu ├── DropdownMenu.module.scss └── DropdownMenu.tsx
1 parent 71c5b05 commit 13530b1

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

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

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

5858
const viewport_height = window.innerHeight
59-
if (top + dropdown_rect.height > viewport_height) {
60-
top = viewport_height - dropdown_rect.height
59+
const is_modern_ui =
60+
document.documentElement.getAttribute('data-modern-ui') == 'true'
61+
62+
if (is_modern_ui) {
63+
if (top + dropdown_rect.height > viewport_height) {
64+
top = viewport_height - dropdown_rect.height
65+
}
66+
} else {
67+
if (top + dropdown_rect.height > viewport_height - 6) {
68+
const overflow = top + dropdown_rect.height - (viewport_height - 6)
69+
top -= overflow
70+
}
6171
}
6272

6373
set_anchor_style({

0 commit comments

Comments
 (0)