Skip to content

Commit

Permalink
hash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
supun-io committed Jun 18, 2023
1 parent 2e652e3 commit 7ba9a22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,14 @@ if (!(window as any).Flashload) {
sendEvent("navigationEnded", {url: this.href})

const hash = getHash(this.href)
console.log(this.href, hash);
if (hash) {
const el = document.getElementById(hash)
el && el.scrollIntoView()
} else {
history.replaceState(null, '', ' ');
// Temporarily disabled this as it works better without it
// history.replaceState(null, '', ' ');
//location.hash = '';
}

}
Expand Down

0 comments on commit 7ba9a22

Please sign in to comment.