InfiniteHits doesn't disable "Show more" button when it loaded the whole hits from the sessionStorage cache.
See original GitHub issue🐛 Bug description
After the whole hits to the last page have been loaded in InfiniteHits and are stored in sessionStorage cache, when reload the page, it successfully load the hits from the cache, but fail to disable “Show more” button.
🔍 Bug reproduction
Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/autumn-butterfly-5jlzc?file=/src/app.js
- Search for any query that gives small amounts of hits (for easy reproduction, eg. “non existing”)
- Scroll down to the bottom and click show more until you reach to the end.
- Remove the
page
query parameter from the URL and reload the page. - You see all the hits are successfully rendered from the cache.
- However “Show more” button is still enabled, and if you click it, it tries to load non-existing page.
Live reproduction:
https://codesandbox.io/s/autumn-butterfly-5jlzc?file=/src/app.js
💭 Expected behavior
“Show more” button is supposed to be disabled.
🖥 Screenshots
https://user-images.githubusercontent.com/499898/107229357-03306b00-6a1e-11eb-97ee-2fa501e3ec9a.mp4
Environment
- OS: macOS 10.15.7
- Browser: FireFox 85.0
Additional context
This issue came in from HelpScout. Once this is fixed, we should apply the update in the Magento extension. Then, search for “https://github.com/algolia/instantsearch.js/issues/4643” in HS, and reply to them about the fix.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to reload Infinite Hits + filters when clicking back in browser
I've currently got gatsby website a react-instantsearch-dom set of results with connectInfiniteHits. There are a couple of filters being ...
Read more >infiniteHits | InstantSearch.js - Algolia
The infiniteHits widget is used to display a list of results with a “Show more” button. To configure the number of hits to...
Read more >Stop div from showing more than once per session or visit
I would like to show this message div only once per visit to the first page the user visits and then then never...
Read more >Disable Browser Back button OR clear session variables on ...
I tried everything but still the problem is that when user hits refresh button, browser is back. Clearing Cache atleast does not display...
Read more >instantsearch.js - UNPKG
src/connectors/infinite-hits/connectInfiniteHits.ts",". ... therefore all the known Algolia properties\n * This doesn't contain any beta/hidden features.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ah, initially the version in the issue topic was 4.7.1. I forgot to fork it before changing it. I just put it back.
the sandbox in the issue topic is using 4.8.1 though @eunjae-lee, are you sure it’s fixed?