I’m been experiencing a potential bug with infiniteHits and I think it’s related to this GitHub issue.
Expected behaviour: when a user clicks on the load more button, new results are shown. When the user clicks on a result they are taken to a new page. When the user clicks the back button, they are taken back to their previous position in search results.
This works in the latest versions of Safari and FireFox, but not in Chrome and Brave. Instead, the user is taken to the bottom of the page.
I’m using Algolia CSS, v7.4.5, which has the fix provided in the GitHub issue so this may be a different bug?
.ais-InfiniteHits-loadPrevious,
.ais-InfiniteHits-loadMore,
.ais-HierarchicalMenu-showMore,
.ais-Menu-showMore,
.ais-RefinementList-showMore {
overflow-anchor: none; }
My code
const search = instantsearch({
indexName: 'index',
searchClient: algoliasearch(
'1234',
'5678'
),
routing: {
stateMapping: instantsearch.stateMappings.singleIndex('index')
}
});
const sessionStorageCache =
instantsearch.createInfiniteHitsSessionStorageCache();
instantsearch.widgets.infiniteHits({
cache: sessionStorageCache,
container: '#infinite-hits',
templates: {
empty: `...`,
item: `...`
}
})
Just bumping this post as I’m still experiencing this issue and would welcome any suggestions on how can I fix/troubleshoot.