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 "Show more" button not working when setting the "aroundRadius" query parameter

See original GitHub issue

Describe the bug 🐛 Setting the ‘aroundRadius’ param , the “Show more” button stops working (widget InfiniteHits). Nothing is displayed in my FF Dev Console (not even the Http POST request querying Algolia servers, so no query is performed)

Commenting the following line solves the problem: helper.setQueryParameter('aroundRadius', 75000);

const search = instantsearch({
  appId: 'latency',
  apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
  indexName: 'instant_search',
  searchParameters: {
    hitsPerPage: 8,
  },
  searchFunction: function (helper) {

    helper.setQueryParameter('aroundRadius', 75000);
    helper.search();
  }
});

Another Search instance (searching on a replica) on the same page still has its “Show more” button working while the bug is present for the first Search instance.

To Reproduce 🔍 Set the ‘aroundRadius’ parameter using the setQueryParameter function inside searchFunction definition Example : https://codesandbox.io/s/43xr3jxk5x

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tdutreuicommented, Sep 5, 2018

good idea 😃 will give it a try !

Le mer. 5 sept. 2018 16:00, Haroen Viaene notifications@github.com a écrit :

What you can do in the future (while this is still a bug) is use the configure widget and mount / unmount it as needed

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/algolia/instantsearch.js/issues/3091#issuecomment-418763452, or mute the thread https://github.com/notifications/unsubscribe-auth/ACTuhrAbp-wODoEXEILgOSpX02KIC78Cks5uX-cZgaJpZM4WZLE_ .

0reactions
Haroenvcommented, Dec 20, 2019

setQueryParameter in the helper resets the page, so if you’re setting it in searchFunction, you need to first get the page, then set the parameter, then reset the page to what it was before. The alternatives suggested don’t have that problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

infiniteHits showMore() not working after upgrading to V 3.0.2
Hello everyone, I have instantsearch with infiniteHits (algolia magento2 module ver. 3.0.2) implemented on Magento2 and It worked fine ...
Read more >
Trigger showMore on infiniteHits widget (Algolia istantsearch.js)
I need to trigger this functionality dinamically, hiding the button, because I want more results on scroll's ending.
Read more >
instantsearch.js - UNPKG
n *\n * When querying algolia, the values stored in this attribute will\n ... n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
Read more >
@meilisearch/instant-meilisearch - npm package | Snyk
Learn more about @meilisearch/instant-meilisearch: package health score, ... routing: browser URL synchronization, search parameters appear in current URL ...
Read more >
React Query Tutorial - 20 - Infinite Queries - YouTube
Your browser can't play this video. Learn more. Switch camera.
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