From a4163798cd19fb252f22ed95c56227195a23744e Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Sat, 17 Oct 2026 16:56:12 -0700 Subject: [PATCH] fix(console): make the mobile menu and copy buttons keyboard accessible (#56591) --- packages/console/app/src/component/header.tsx | 15 ++++++++++++++- packages/console/app/src/routes/brand/index.css | 3 ++- .../console/app/src/routes/download/index.css | 3 ++- .../console/app/src/style/component/focus.css | 9 +++++++++ packages/console/app/src/style/index.css | 1 + 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 packages/console/app/src/style/component/focus.css diff --git a/packages/console/app/src/component/header.tsx b/packages/console/app/src/component/header.tsx index bdef0403e5c..c96fe74ff77 100644 --- a/packages/console/app/src/component/header.tsx +++ b/packages/console/app/src/component/header.tsx @@ -46,6 +46,18 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo contextMenuPosition: { x: 0, y: 0 }, }) + let mobileToggle: HTMLButtonElement | undefined + createEffect(() => { + if (!store.mobileMenuOpen) return + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key !== "Escape") return + setStore("mobileMenuOpen", false) + mobileToggle?.focus() + } + document.addEventListener("keydown", handleKeyDown) + onCleanup(() => document.removeEventListener("keydown", handleKeyDown)) + }) + createEffect(() => { const handleClickOutside = () => { setStore("contextMenuOpen", false) @@ -215,9 +227,10 @@ export function Header(props: { zen?: boolean; go?: boolean; hideGetStarted?: bo