Signed-off-by: Sydney Achinger <sydneynicoleachinger@spotify.com>
This commit is contained in:
Sydney Achinger
2023-10-18 13:59:12 -04:00
parent 4728b3960d
commit ad2de37115
@@ -86,8 +86,10 @@ export const TechDocsReaderPageContent = withTechDocsReaderProvider(
const [hashElement] = useShadowRootElements([`[id="${hash.slice(1)}"]`]);
useEffect(() => {
if (hashElement && !isStyleLoading) {
hashElement.scrollIntoView();
if (hash) {
if (hashElement && !isStyleLoading) {
hashElement.scrollIntoView();
}
} else {
document?.querySelector('header')?.scrollIntoView();
}