Second click refreshes the page #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi MoOx! If I click on a link twice... The page is refreshed.
Reproductible on your own site :)
Any idea?
It's not a bug, it's a feature. As a user I expect an action if I click on a link I'm already on. I didnt want to do nothing or just reload the content cause of my website effect (slide on smae content doesnt make sense).
Any idea on how to handle that special click ? Simple content refresh ? Current behavior ? Specific callback ?
Thanks for your answer. In some cases, this behavior can entirely break the user experience. Let's take an example. I have a video/audio player that must continuously play a movie/audio while the user is browsing the site. If the user clicks multiple times on a link, the page is reloaded and so kills the player. That would be cool to let developers handling this special click. I (personally) would just go for a simple content refresh (because that's the behavior we expect of PJAX — no full page reload).
CC @pascalgermain
Hi MoOx. I'm currently developing a website for a web tv. One of the main needs is to display a player, and never "break" it during the user navigation, that's why I looked for a pjax library, and yours is the best I found :)
I understand the second click on a same link is handled as a special case, so maybe the best way to do this would be to create an option, allowing to decide which one of the behaviors is triggered? That would be a choice between the three you propose: simple content refresh, current behavior, or custom via a callback, default being current one. Or maybe all three can be handled via a callback? I'm not sure.
Maybe we can just drop this behavior for now. This should not be the default behavior by default indeed. Maybe an opion but later :)
I'm on vacation for 15days so you should patch this for now.
Pr are welcome but I wont be able to publish a release until 15 sept.
I disabled the current behavior and added a new option
clickReload(not documented, only code) in PR #15. Bonnes vacances :)Closing in favor of #17 (and #15 fix that for now)