v1.8.35: dropdown full-width on mobile — no overlap possible

This commit is contained in:
2026-05-28 23:15:09 +00:00
parent 97653ef882
commit 3cacf637f1
9 changed files with 13 additions and 5 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+13 -5
View File
@@ -210,11 +210,19 @@
e.stopPropagation(); e.stopPropagation();
const btn = document.getElementById('uh-btn'); const btn = document.getElementById('uh-btn');
const rect = btn.getBoundingClientRect(); const rect = btn.getBoundingClientRect();
drop.style.top = (rect.bottom + 6) + 'px'; drop.style.top = (rect.bottom + 6) + 'px';
drop.style.left = rect.left + 'px'; if (window.innerWidth < 640) {
// Keep within viewport // Mobile: full width below header, no overlap possible
const rightEdge = rect.left + 176; drop.style.left = '8px';
if (rightEdge > window.innerWidth - 8) drop.style.left = (window.innerWidth - 184) + 'px'; drop.style.right = '8px';
drop.style.width = 'auto';
} else {
// Desktop: align to button
drop.style.right = 'auto';
drop.style.width = '11rem';
const left = Math.max(8, Math.min(rect.left, window.innerWidth - 184));
drop.style.left = left + 'px';
}
drop.classList.toggle('hidden'); drop.classList.toggle('hidden');
}); });