Skip to content

Commit 61b49b1

Browse files
authored
Fix #520 (disabled autocomplete with active facet query rule) (#866)
1 parent 4f92531 commit 61b49b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

view/frontend/web/instantsearch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ requirejs(['algoliaBundle','Magento_Catalog/js/price-utils'], function(algoliaBu
7070
* Docs: https://community.algolia.com/instantsearch.js/
7171
**/
7272

73-
var ruleContexts = ['']; // Empty context to keep BC for already create rules in dashboard
73+
var ruleContexts = ['magento_filters', '']; // Empty context to keep BC for already create rules in dashboard
7474
if (algoliaConfig.request.categoryId.length > 0) {
7575
ruleContexts.push('magento-category-' + algoliaConfig.request.categoryId);
7676
}
@@ -175,7 +175,7 @@ requirejs(['algoliaBundle','Magento_Catalog/js/price-utils'], function(algoliaBu
175175
},
176176
render: function (data) {
177177
if (!algoliaConfig.isSearchPage) {
178-
if (data.results.query.length === 0) {
178+
if (data.results.query.length === 0 && data.results.nbHits === 0) {
179179
$('.algolia-instant-replaced-content').show();
180180
$('.algolia-instant-selector-results').hide();
181181
}

0 commit comments

Comments
 (0)