Skip to content

Commit 45cb6e3

Browse files
authored
Merge pull request #8233 from github/repo-sync
repo sync
2 parents 4afe720 + d3be242 commit 45cb6e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/product/SidebarProduct.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ export const SidebarProduct = () => {
1515
// Setting to the top doesn't give enough context of surrounding categories
1616
activeArticle?.scrollIntoView({ block: 'center' })
1717
// scrollIntoView affects some articles that are very low in the sidebar
18-
// The content scrolls down a bit. This sets the article content back up top
19-
window?.scrollTo(0, 0)
18+
// The content scrolls down a bit. This sets the article content back up
19+
// top unless the route contains a link heading.
20+
if (!router.asPath.includes('#')) window?.scrollTo(0, 0)
2021
}, [])
2122

2223
if (!currentProductTree) {

0 commit comments

Comments
 (0)