Skip to content

Commit 39bc804

Browse files
committed
fix(frontend): re-enable linking to # on data page
1 parent 4bad805 commit 39bc804

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

browser/src/DataPage/DataPage.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react'
1+
import React, { useEffect } from 'react'
22
import styled from 'styled-components'
33

44
import { Badge, ExternalLink, PageHeading } from '@gnomad/ui'
@@ -53,6 +53,16 @@ const DataPage = () => {
5353
// Load stylesheet to make smooth scroll behavior active
5454
const _style = styles.html
5555

56+
useEffect(() => {
57+
const hash = window.location.hash
58+
if (hash !== '') {
59+
const element = document.querySelector(`${hash}`)
60+
if (element) {
61+
element.scrollIntoView()
62+
}
63+
}
64+
}, [])
65+
5666
return (
5767
<InfoPage>
5868
<DocumentTitle title="Data" />

0 commit comments

Comments
 (0)