pagerjs icon indicating copy to clipboard operation
pagerjs copied to clipboard

Prevent navigation guard still updates currentChild?

Open TomStrepsil opened this issue 11 years ago • 1 comments

I'm experimenting with pager and history.js

I was hoping that by not firing the guard callback, pager could prevent the url changing to a new path, and prevent the old page from being hidden. As it is, although the guard prevents the new page showing, the page-href has already been actioned.

A basic fiddle with the callback not being fired shows that the first page still gets hidden when clicking Page 2. Outside of jsfiddle, the url would be updated to #page2, also.

http://jsfiddle.net/Lc1am4ah/1/

Is there any way to mitigate this? I assume I will otherwise have to "bind to global click" (http://pagerjs.com/demo/#!/navigation/custom_js_when_navigating) to control workflow, which I'm not too keen on.

TomStrepsil avatar Feb 24 '15 13:02 TomStrepsil

Similarly, shouldn't the local click handler prevent navigation, if it doesn't return true?

http://jsfiddle.net/Lc1am4ah/2/

Seems like the click handler fires after navigation..

TomStrepsil avatar Feb 24 '15 13:02 TomStrepsil