fix: Links with anchors are broken when pages are renamed

closes #3553
This commit is contained in:
Tom Moor
2022-05-20 09:43:54 +01:00
parent 39e146b4e6
commit 0577c73f06
2 changed files with 2 additions and 1 deletions

View File

@@ -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