From b4da777bdcad779e2c468bb65fe0963889ef822e Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 18 Mar 2026 13:08:37 -0700 Subject: [PATCH] Fix automation group dropdown clipped at bottom of page Dropdown always opened downward, getting cut off for the last row. Now checks available space and flips upward when near viewport bottom. --- webui/static/script.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webui/static/script.js b/webui/static/script.js index 2f51a390..bd3129dd 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -55960,12 +55960,19 @@ function _showGroupDropdown(event, autoId, currentGroup) { // Position dropdown on document.body to avoid overflow:hidden clipping const rect = btn.getBoundingClientRect(); dropdown.style.position = 'fixed'; - dropdown.style.top = (rect.bottom + 4) + 'px'; dropdown.style.right = (window.innerWidth - rect.right) + 'px'; dropdown.style.left = 'auto'; document.body.appendChild(dropdown); _activeGroupDropdown = dropdown; + // Open upward if not enough room below + const dropdownHeight = dropdown.offsetHeight; + if (rect.bottom + 4 + dropdownHeight > window.innerHeight && rect.top - 4 - dropdownHeight > 0) { + dropdown.style.top = (rect.top - 4 - dropdownHeight) + 'px'; + } else { + dropdown.style.top = (rect.bottom + 4) + 'px'; + } + // Focus the input setTimeout(() => dropdown.querySelector('.auto-group-input')?.focus(), 50);