Skip Navigation

[Escalated to 2nd Tier] AJAX pagination scroll behavior

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 1 voice.

Last updated by Minesh 5 days, 3 hours ago.

Assisted by: Minesh.

Author
Posts
#2838171

I'm reaching out with two issues. The first is my primary concern, but the second came up while troubleshooting.

1. I am trying to use the "Pagination enabled with manual transition and AJAX" setting for a toolset view displaying some products. The pagination controls work, but there is some strange scroll behavior. After choosing a page with the pagination controls, the window jumps to a position far below the product display area. Here is an example of the product page with ajax pagination: hidden link

EDIT: I have added JS event listeners on the pagination controls to work around the ajax request and navigate directly to the pagination links before any other JS can force the weird scrolling behavior.

For some context: we are using the Enfold theme and we have tried tracking down and temporarily disabling any javascript that we suspect might be controlling this strange scroll behavior.

2. While trouble shooting, I tried switching from AJAX to "Pagination enabled with manual transition and page reload", but that produced some errors in the console, and the pagination controls did not work at all. Here is the error:

Uncaught TypeError: Cannot read properties of undefined (reading 'submit')
at t.trigger_pagination (views-frontend.js?ver=3.6.21:1:36802)
at HTMLAnchorElement.<anonymous> (views-frontend.js?ver=3.6.21:1:39599)
t.trigger_pagination @ views-frontend.js?ver=3.6.21:1
(anonymous) @ views-frontend.js?ver=3.6.21:1

Any help would be much appreciated!

#2838199

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I remember similar issue recently reported by another user but in order to ensure that its the same issue, I will have to check your view settings.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2838439

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - this is a known issue to us and another user recently reported it and I already escalated the issue in front of our Devs.

For now, you can share the JS/Javascript workaround you have in benefit of other users and I've added your voice to our internal ticket that will help our Devs to priotarize the issue accordingly.

#2838519

Here is the Javascript I added to work around the AJAX request and preempt any other JS that might be causing the scroll jumping behavior. It just adds an event listener to pagination <a> elements with a callback that redirects to the href that would normally be used for the AJAX request.

// Adjust query selector here to meet your specificity requirements
const paginationLinks = document.querySelectorAll('.wpv-filter-pagination-link');

if (paginationLinks.length === 0) {
return;
} else {
paginationLinks.forEach( link => {

link.addEventListener('click', function(event) {

//stop immediate propagation in the capture phase is needed to prevent other event listener
// callbacks from firing (including js that might scroll to weird places)
event.stopImmediatePropagation();

event.preventDefault();

//forces navigation to the pagination link with full page reload, bypassing AJAX request
window.location.href = link.href;
}, true);
})
}

#2838604

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thank you for sharing workaround. As shared I've escalted the ticket in front of our Devs but there is no ETA about when the fix will be make available.