From b12de415f4a40b6963915f03085344f7ad61502d Mon Sep 17 00:00:00 2001 From: Alvaro <110414366+alvaro-signal@users.noreply.github.com> Date: Thu, 13 Oct 2022 10:09:21 -0600 Subject: [PATCH] Fixed auto-focus on stories pane --- ts/components/StoriesPane.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts/components/StoriesPane.tsx b/ts/components/StoriesPane.tsx index fabb0838fbe..23569158209 100644 --- a/ts/components/StoriesPane.tsx +++ b/ts/components/StoriesPane.tsx @@ -25,6 +25,7 @@ import { StoriesAddStoryButton } from './StoriesAddStoryButton'; import { StoryListItem } from './StoryListItem'; import { Theme } from '../util/theme'; import { isNotNil } from '../util/isNotNil'; +import { useRestoreFocus } from '../hooks/useRestoreFocus'; const FUSE_OPTIONS: Fuse.IFuseOptions = { getFn: (story, path) => { @@ -110,10 +111,13 @@ export const StoriesPane = ({ } }, [searchTerm, stories]); + const [focusRef] = useRestoreFocus(); + return ( <>