Second click refreshes the page #14

Closed
opened 2014-08-30 14:50:00 -05:00 by gillesfabio · 6 comments
gillesfabio commented 2014-08-30 14:50:00 -05:00 (Migrated from github.com)

Hi MoOx! If I click on a link twice... The page is refreshed.

Reproductible on your own site :)

Any idea?

Hi MoOx! If I click on a link twice... The page is refreshed. Reproductible on [your own site](http://moox.io/) :) Any idea?
MoOx commented 2014-08-30 16:00:41 -05:00 (Migrated from github.com)

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 ?

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 ?
gillesfabio commented 2014-08-31 03:27:33 -05:00 (Migrated from github.com)

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

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
pascalgermain commented 2014-08-31 05:25:55 -05:00 (Migrated from github.com)

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.

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.
MoOx commented 2014-08-31 13:44:30 -05:00 (Migrated from github.com)

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.

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.
gillesfabio commented 2014-09-01 02:53:49 -05:00 (Migrated from github.com)

I disabled the current behavior and added a new option clickReload (not documented, only code) in PR #15. Bonnes vacances :)

I disabled the current behavior and added a new option `clickReload` (not documented, only code) in PR #15. Bonnes vacances :)
MoOx commented 2014-09-15 23:51:22 -05:00 (Migrated from github.com)

Closing in favor of #17 (and #15 fix that for now)

Closing in favor of #17 (and #15 fix that for now)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#14