B-214: keep desktop header commands visible instead of behind ellipsis
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
cf7183d0c0
commit
152c0000ce
@@ -22,12 +22,19 @@
|
||||
const button = document.querySelector("#headerMenuButton");
|
||||
const backdrop = document.querySelector("#mobileCommandBackdrop");
|
||||
if (!menu || !button) return;
|
||||
if (!isMobileViewport()) {
|
||||
menu.classList.remove("is-open");
|
||||
button.setAttribute("aria-expanded", "false");
|
||||
document.body.classList.remove("mobile-command-open");
|
||||
if (backdrop) backdrop.hidden = true;
|
||||
return;
|
||||
}
|
||||
const open = typeof force === "boolean" ? force : !menu.classList.contains("is-open");
|
||||
menu.classList.toggle("is-open", open);
|
||||
button.setAttribute("aria-expanded", String(open));
|
||||
document.body.classList.toggle("mobile-command-open", open && isMobileViewport());
|
||||
if (backdrop) backdrop.hidden = !(open && isMobileViewport());
|
||||
if (open && isMobileViewport()) {
|
||||
document.body.classList.toggle("mobile-command-open", open);
|
||||
if (backdrop) backdrop.hidden = !open;
|
||||
if (open) {
|
||||
global.requestAnimationFrame(() => menu.querySelector("button:not([hidden])")?.focus({ preventScroll: true }));
|
||||
} else if (force === false && document.activeElement && menu.contains(document.activeElement)) {
|
||||
button.focus({ preventScroll: true });
|
||||
|
||||
Reference in New Issue
Block a user