This commit is contained in:
Ian Gulliver
2026-10-15 22:15:36 -07:00
parent 32c2b56b5d
commit fb615a5e61
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -148,8 +148,10 @@ export function openSwitcher() {
backdrop.onclick = close;
const anchor = document.querySelector(".task-picker").getBoundingClientRect();
box.style.top = `${anchor.bottom + 4}px`;
box.style.right = `${document.documentElement.clientWidth - anchor.right}px`;
document.body.append(backdrop, box);
const viewport = document.documentElement.clientWidth;
const left = anchor.left + anchor.width / 2 - box.offsetWidth / 2;
box.style.left = `${Math.max(8, Math.min(left, viewport - box.offsetWidth - 8))}px`;
render();
input.focus();
}