Skip to content

Commit

Permalink
update: enhance the scroll.
Browse files Browse the repository at this point in the history
  • Loading branch information
Koooooo-7 committed Oct 7, 2022
1 parent 91272ca commit b48ca18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/router/history/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ export class HashHistory extends History {
const el = e.target.tagName === 'A' ? e.target : e.target.parentNode;

if (el && el.tagName === 'A' && !/_blank/.test(el.target)) {
navigating = true;
// When click the same naigator in sidebar, it won't trigger the hashchange event, even though the content already scroll down and active other anchor.
// In this scenario, we do the navigating thing via the click event.
if (el.hash && el.hash === window.location.hash) {
const source = 'navigate';
cb({ event: e, source });
} else {
navigating = true;
}
}
});

Expand Down

0 comments on commit b48ca18

Please sign in to comment.