fix: update location.hash when following links in preview (#60343)

This commit is contained in:
Oliver Eyton-Williams
2025-05-14 20:59:56 +02:00
committed by GitHub
parent b772485fe6
commit 81502125dd
@@ -133,11 +133,7 @@ const createHeader = (id = mainPreviewId) =>
else if (href.match(/^#.+/)) {
e.preventDefault();
const scrollId = href.substring(1);
const scrollElem = document.getElementById(scrollId);
if (scrollElem) {
scrollElem.scrollIntoView();
}
window.location.hash = scrollId;
}
}
}, false);