Comments (5)
Hello everyone, same issue here with hummingbird, also with paginated parameters ( ?page=2) when using the Back button.
User is redirected to the previous page then instantly on a 404 page : myshop.fr/[object History]
from hummingbird.
I have identified the line of code that seems to cause the problem.
File /src/js/modules/facetedsearch/update.ts line 98
if ($(Theme.selectors.listing.list).length) {
window.addEventListener('popstate', (e) => {
const {state} = e;
window.location.href = state && state.current_url ? state.current_url : history;
});
}
from hummingbird.
I have identified the line of code that seems to cause the problem. File /src/js/modules/facetedsearch/update.ts line 98
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?
window.location.reload();
Edit:
Without this popstate listener on back navigation the facet checkboxes selection state won't update based on the url change, that's why the window.location.href needs to be set, and force reloaded to avoid caching issues.
from hummingbird.
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:
if (state && state.current_url) {
window.location.href = state.current_url;
} else {
window.history.back();
}
from hummingbird.
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:
if (state && state.current_url) { window.location.href = state.current_url; } else { window.history.back(); }
I've tested this with the following,
Homepage -> Category page -> Changed price filter -> Back button
This returned me back to the homepage.
from hummingbird.
Related Issues (20)
- Carrier extra content not visible when changing between order steps from "header" HOT 3
- hummingbird - In Checkout process, Personal Information tab, wording in incorrect HOT 22
- Only the first wishlist is clickable in humingbird theme HOT 5
- Release v0.1.7 HOT 2
- Replace "else if" smarty conditions by "elseif" as officially recommanded HOT 5
- The Min quantity config is always preselected regardless of the quantity in the cart
- In Order details page - If my product has a downloadable file, I can't download it
- In Shopping cart - If you check the Customized button, there's a warning HOT 6
- Guest checkout: Use different invoice address : Can't order
- In product page - The Add to cart button is greyed out when I change quantity to 0 and back to a positive quantity
- Product page - Product price with a volume discount is incorrect until I add the product to my cart
- Tags are not displayed on product details page, quick view and product listing page when product has no image HOT 1
- missing types for `window.prestashop`
- In Shopping cart page, when you put 0 on the quantity and press Enter, the product won't be removed
- When you add a product with a minimal quantity to your cart, the product quantity should be updated
- Unusable menu dropdown when store logo is tall HOT 3
- For the module productcomments, the stars are not displayed on category page HOT 2
- v0.2.0 release does not contain zip packaged version of the theme HOT 1
- ps_mainmenu issue when too many items for one row
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hummingbird.