fix: anchor link need decode (#719)
This commit is contained in:
parent
ff7a56a7ac
commit
3ff06fe033
@ -21,7 +21,7 @@ function setupSmoothAnchors() {
|
|||||||
aElement.addEventListener("click", clickEvent => {
|
aElement.addEventListener("click", clickEvent => {
|
||||||
clickEvent.preventDefault();
|
clickEvent.preventDefault();
|
||||||
|
|
||||||
const targetId = aElement.getAttribute("href").substring(1),
|
const targetId = decodeURI(aElement.getAttribute("href").substring(1)),
|
||||||
target = document.getElementById(targetId) as HTMLElement,
|
target = document.getElementById(targetId) as HTMLElement,
|
||||||
offset = target.getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top;
|
offset = target.getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user