mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: align teleported dropdown to trigger left edge instead of right
Amp-Thread-ID: https://ampcode.com/threads/T-019d6fd8-61fd-76ed-975a-71e146c1dd5e Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -178,11 +178,15 @@ function toggleDropdown() {
|
||||
spaceBelow < MENU_HEIGHT_WITH_GAP && spaceAbove > spaceBelow
|
||||
|
||||
if (shouldTeleport) {
|
||||
const left = Math.max(
|
||||
0,
|
||||
Math.min(rect.left, window.innerWidth - MENU_WIDTH)
|
||||
)
|
||||
fixedPosition.value = {
|
||||
top: openUpward.value
|
||||
? Math.max(MENU_HEIGHT_WITH_GAP, rect.top)
|
||||
: Math.min(rect.bottom, window.innerHeight - MENU_HEIGHT_WITH_GAP),
|
||||
left: Math.min(rect.right, window.innerWidth - MENU_WIDTH)
|
||||
left
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user