From 74385aa54d3ea7c461f83abceb398cc94a141f32 Mon Sep 17 00:00:00 2001 From: Oliver Baker Date: Tue, 24 Oct 2023 14:45:28 -0500 Subject: [PATCH] fix(spotlight, usescrollobserver): automatically scroll nearest scrollable element Instead of always trying to scroll the window to highlight the target, it now finds the nearest scrollable element and scrolls that instead. Many times, that will be the window/html element fixes #481 --- src/components/Spotlight/Spotlight.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Spotlight/Spotlight.tsx b/src/components/Spotlight/Spotlight.tsx index 8c5261bb3..c3157e7c1 100644 --- a/src/components/Spotlight/Spotlight.tsx +++ b/src/components/Spotlight/Spotlight.tsx @@ -387,7 +387,7 @@ const Spotlight = ({ prefersReducedMotion, ]); - /* Click */ + /* onClick */ const handleClick = (evt: MouseEvent) => { // TODO: Rename to onClickOutside?