refactor
Signed-off-by: Sydney Achinger <sydneynicoleachinger@spotify.com>
This commit is contained in:
+4
-2
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user