-
Anchor links pointing to a fragment fires History API's "popstate" event
posted in JavaScript on 2022-11-15 history popstate anchor javascript -
I hit an interesting "bug" while working on a SPA application. Clicking an anchor link that points to a fragment on the page fires the History API's
read morepopstate
event. This triggers some logic on my end, which was not my intent. I fixed that with a bit of JavaScript, and I had to share the snippet.