Closed awei01 closed 7 years ago
Ah, yes, "correct behaviour" is a bit difficult to define :)
To make it work as you expect you always have to:
addressbar.on('change', (event) => {
event.preventDefault()
})
This is the code that takes control of the addressbar.
It is a while since I wrote the code, but I believe change
is hooked up to both a href clicks and pushState events... to be able to prevent a href clicks it needs to listen to those clicks, but it also needs to listen to pushState events to handle them as well. So yeah... might be a way to make this more predictable though
Ok, thanks for the response.
When an
<a>
tag with href changes url, theaddressbar.on('change')
fires twice.Here's a repo I created to replicate issue: https://github.com/awei01/addressbar-test
Tested on firefox and chrome.