WIP: Issue with AJAX pagination not scrolling to top when using the browser back button

Hey Bricks team,

I’ve encountered a UX issue that might be considered a bug:

When using pagination with AJAX enabled, everything works fine when navigating forward. However, if I click the browser’s back button, the page scrolls back to the last pagination position (i.e., near the pagination element), not to the top of the page.

Expected behavior:
After hitting the browser back button, the page should scroll to top: 0 (or a specific section ID), especially when returning to an AJAX-loaded pagination state.

What would help
It would be great if Bricks could:

  • Automatically scroll to top when navigating back to a paginated page with AJAX, or
  • Provide a setting to disable browser scroll restoration, or
  • Trigger a custom hook/event on history navigation we can hook into via JS.
2 Likes

Hi,
Welcome to the forum, and thanks so much for your report!

Non-existent logic is rarely a bug, but rather a feature request or improvement :slight_smile: That’s why I moved the thread. Let’s see if we can implement this in the future.

Best regards,
timmse

1 Like

Hey, thanks for replay. Yes I agree with you. So let’s hope it gets picked up. :smiley:

Cheers Katharina

Hey, I have opposite problem. I have AJAX pagination in woocommerce store and if I open product from page xy, it goes back to the top and user needs to scroll down again and again.

How to solve this? :slight_smile:

sounds like a great feature addition.

+1

in the meantime I’ll see if I can fix it myself with some custom JS.