question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. Go to https://codesandbox.io/s/autumn-butterfly-5jlzc?file=/src/app.js
  2. Search for any query that gives small amounts of hits (for easy reproduction, eg. “non existing”)
  3. Scroll down to the bottom and click show more until you reach to the end.
  4. Remove the page query parameter from the URL and reload the page.
  5. You see all the hits are successfully rendered from the cache.
  6. 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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
eunjae-leecommented, Feb 17, 2021

the sandbox in the issue topic is using 4.8.1 though @eunjae-lee, are you sure it’s fixed?

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.

0reactions
Haroenvcommented, Feb 17, 2021

the sandbox in the issue topic is using 4.8.1 though @eunjae-lee, are you sure it’s fixed?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found