From 98baf0507b282eb046c0157bd3bd323069a89ec3 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:28:23 -0700 Subject: [PATCH] Fix location of quicklaunch, some focus issues --- src/components/quicklaunch.jsx | 15 ++++++++++++--- src/pages/index.jsx | 21 +++++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/components/quicklaunch.jsx b/src/components/quicklaunch.jsx index c371ccf68..0304f038e 100644 --- a/src/components/quicklaunch.jsx +++ b/src/components/quicklaunch.jsx @@ -61,7 +61,6 @@ export default function QuickLaunch({servicesAndBookmarks, searchString, setSear } } - function handleItemHover(event) { setCurrentItemIndex(parseInt(event.target?.dataset?.index, 10)); } @@ -71,6 +70,16 @@ export default function QuickLaunch({servicesAndBookmarks, searchString, setSear openCurrentItem(event.metaKey); } + function handleItemKeyDown(event) { + if (!isOpen) return; + + // native button handles other keys + if (event.key === "Escape") { + closeAndReset(); + event.preventDefault(); + } + } + useEffect(() => { if (searchString.length === 0) setResults([]); else { @@ -162,10 +171,10 @@ export default function QuickLaunch({servicesAndBookmarks, searchString, setSear {results.length > 0 &&