diff --git a/app/editor/index.tsx b/app/editor/index.tsx index 6d7b64cb8..9e1cbb8d7 100644 --- a/app/editor/index.tsx +++ b/app/editor/index.tsx @@ -471,7 +471,7 @@ export class Editor extends React.PureComponent< try { const element = document.querySelector(hash); if (element) { - element.scrollIntoView({ behavior: "smooth" }); + setTimeout(() => element.scrollIntoView({ behavior: "smooth" }), 0); } } catch (err) { // querySelector will throw an error if the hash begins with a number diff --git a/app/scenes/Document/components/Document.tsx b/app/scenes/Document/components/Document.tsx index 4d8039f15..d7af65b59 100644 --- a/app/scenes/Document/components/Document.tsx +++ b/app/scenes/Document/components/Document.tsx @@ -456,6 +456,7 @@ class DocumentScene extends React.Component { to={{ pathname: canonicalUrl, state: this.props.location.state, + hash: this.props.location.hash, }} /> )}