diff --git a/src/components/Link/Link.jsx b/src/components/Link/Link.jsx index 99adcefa7de9..b8ad68b3f4df 100644 --- a/src/components/Link/Link.jsx +++ b/src/components/Link/Link.jsx @@ -1,6 +1,14 @@ import React from 'react'; import { Link } from 'react-router-dom'; +function offsetAnchor() { + if(location.hash.length !== 0) { + window.scrollTo(window.scrollX, window.scrollY - 100); + } +} +window.addEventListener('hashchange', offsetAnchor); +window.setTimeout(offsetAnchor, 1); + export default ({ to = '', url,