Open aldebaran798 opened 7 years ago
That's how should work, however sometimes is not the wanted behaviour.
What you can do however is add a handler on that particular link to verify if you are in the same path, but in order to avoid page to kick in the router process you will need to add target="_self" to the href, and when you are not do page.show(e.target.href)
If I understand that workaround correctly, it seems like the complexity it'd add to the code would outweigh the benefit, at least in my project.
@tj, would you be interested in a PR that would add a config flag or some other simple way for users to determine how page.js behaves in this situation? Or do you prefer to just leave it the way it is?
Is it possible to prevent pushstate from a URL in a link if the URL is the same as the current one? For example, if I have a link that sends to a contact page, each time I press the link, the URL is always entered in the history, and when I want to go back, I have to press the button the same number of times I pressed the link