mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: prevent teleported dropdown from overflowing viewport top
Amp-Thread-ID: https://ampcode.com/threads/T-019d2d64-af34-7489-abd5-cde23ead7105 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -178,6 +178,9 @@ function toggleDropdown() {
|
||||
spaceBelow < MENU_HEIGHT_WITH_GAP && spaceAbove > spaceBelow
|
||||
|
||||
if (shouldTeleport) {
|
||||
if (openUpward.value && rect.top < MENU_HEIGHT_WITH_GAP) {
|
||||
openUpward.value = false
|
||||
}
|
||||
fixedPosition.value = {
|
||||
top: openUpward.value ? rect.top : rect.bottom,
|
||||
left: Math.min(rect.right, window.innerWidth - MENU_WIDTH)
|
||||
|
||||
Reference in New Issue
Block a user