Skip to content

Commit

Permalink
fix(v2): add support for non-ASCII chars in anchor link scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Nov 11, 2020
1 parent bde4062 commit 7483380
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const useHideableNavbar = (hideOnScroll: boolean): useHideableNavbarReturns => {
}

setIsFocusedAnchor(true);
setIsNavbarVisible(false);
}, [hash]);

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/src/client/PendingNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class PendingNavigation extends React.Component<Props, State> {
if (!hash) {
window.scrollTo(0, 0);
} else {
const id = hash.substring(1);
const id = decodeURIComponent(hash.substring(1));
const element = document.getElementById(id);
if (element) {
element.scrollIntoView();
Expand Down

0 comments on commit 7483380

Please sign in to comment.