diff --git a/src/templates/Typedoc/TocScroll.jsx b/src/templates/Typedoc/TocScroll.jsx index 049e0d7e..c94ff3dc 100644 --- a/src/templates/Typedoc/TocScroll.jsx +++ b/src/templates/Typedoc/TocScroll.jsx @@ -41,6 +41,11 @@ export default class TocScroll extends React.Component { scroll ? this.scrollTo(elem, offset, timeout) : console.log(`Element not found: ${element}`) // eslint-disable-line + + // update browser url + if (typeof window !== 'undefined') { + window.history.pushState({}, null, `#${element}`) + } } scrollTo(element, offSet = 0, timeout = null) {