Center
This commit is contained in:
Vendored
+3
-1
@@ -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();
|
||||
}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user