Wordpress: stuck when navigating back #462
-
HI SWUP & co. I have a side...issue. Not big but would like to get it solved. We have a wordpress site built with SWUP. Issue: It also doesn't seem to follow the normal SWUP process, as I added a few alerts to see if it's ever registering the 'pageRetrievedFromCache', 'popState' or 'pageView' events. When initially clicked, debug mode in the console shows a few items loading, but then the content is replaced with the image, and clicking 'back' brings up the previous page but it doesn't complete loading. or doesn't register that it ever left perhaps? Normally I'd disable direct image linking in WP, but was wondering if there's something in my setup I should do to to cover this happening? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You could try adding a [data-no-swup] attribute to the |
Beta Was this translation helpful? Give feedback.
-
Another option is to prevent the click event in the capturing phase, before swup will process it. See this issue comment for an example. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help everyone. This was solved in three ways, but is still abit of a patch. First, linkSelector was expanded to skip all target="_blank" Secondly, Swup needed to be updated to be able to recognise when it comes back to itself. So needed a newer version of the plugin. Thirdly, I wrote a function to force all image links to open in new tabs. If I added a lightbox later I'd remove this. It just adds _blank to any image href's (using the isImage() function) it finds on links.
|
Beta Was this translation helpful? Give feedback.
Another option is to prevent the click event in the capturing phase, before swup will process it. See this issue comment for an example.