-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect URL redirection when using browser back button #613
Comments
Hello everyone, same issue here with hummingbird, also with paginated parameters ( ?page=2) when using the Back button. |
I have identified the line of code that seems to cause the problem. if ($(Theme.selectors.listing.list).length) {
window.addEventListener('popstate', (e) => {
const {state} = e;
window.location.href = state && state.current_url ? state.current_url : history;
});
} |
Could you add this line after window.location.href to force a refresh, and test?
Edit: |
Type 'History' is not assignable to type 'string'. So it can't be set on window.location.href. Thats why we got [object%20History] why not using:
|
I've tested this with the following, Homepage -> Category page -> Changed price filter -> Back button This returned me back to the homepage. |
Describe the bug:
Navigating back using the browser's "Back" button after changing the product sort order on a product list page redirects the user to an incorrect URL:
/[object%20History]
. This issue disrupts the user's browsing experience by not correctly returning them to the previous state.Expected behavior:
Users should be redirected to the previous page with the initial state or sort order intact when using the browser's "Back" button. This behavior is expected to work seamlessly, similar to how it functions with the default PrestaShop theme.
Steps to reproduce the issue:
Whatever the browser used.
PrestaShop version(s) where the bug happened:
8.1.5
PHP version(s) where the bug happened:
8.1
The text was updated successfully, but these errors were encountered: