From 3b71825fbeb001e5007eb9be96053eadb987bf52 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Thu, 18 Jan 2024 14:53:13 -0600 Subject: [PATCH] Use sidebarTransitionTime for timing --- src/app/content/components/TableOfContents/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/content/components/TableOfContents/index.tsx b/src/app/content/components/TableOfContents/index.tsx index 62901297a5..5f9235ccc6 100644 --- a/src/app/content/components/TableOfContents/index.tsx +++ b/src/app/content/components/TableOfContents/index.tsx @@ -12,6 +12,7 @@ import { archiveTreeContainsNode, getArchiveTreeSectionType } from '../../utils/ import { expandCurrentChapter, scrollSidebarSectionIntoView, setSidebarHeight } from '../../utils/domUtils'; import { stripIdVersion } from '../../utils/idUtils'; import { CloseToCAndMobileMenuButton, TOCBackButton, TOCCloseButton } from '../SidebarControl'; +import { sidebarTransitionTime } from '../constants'; import { Header, HeaderText, SidebarPaneBody } from '../SidebarPane'; import { LeftArrow, TimesIcon } from '../Toolbar/styled'; import * as Styled from './styled'; @@ -67,7 +68,7 @@ const SidebarBody = React.forwardRef< 'ol > li a, old > li summary' ) as HTMLElement; - setTimeout(() => firstItemInToc?.focus(), 100); + setTimeout(() => firstItemInToc?.focus(), sidebarTransitionTime); } }, [props.isTocOpen, mRef]