Skip to content

Commit

Permalink
fix(Facet): avoid to unmount the RefinementList when no results from …
Browse files Browse the repository at this point in the history
…SFFV (#11)
  • Loading branch information
samouss authored and Haroenv committed Jul 11, 2018
1 parent 75b8f24 commit 2dde181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion demos/react/ecommerce/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ a {
margin-bottom: 16px;
}

.ais-RefinementList-item {
.ais-RefinementList-item,
.ais-RefinementList-noResults {
padding: 8px 16px;
}

Expand Down
8 changes: 4 additions & 4 deletions demos/react/ecommerce/src/Facet.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import { RefinementList } from "react-instantsearch-dom";
import { connectRefinementList } from "react-instantsearch/connectors";
import { RefinementList, connectRefinementList } from "react-instantsearch-dom";

export default connectRefinementList(
({ translations, searchable, attribute, items }) =>
items.length && items.length > 0 ? (
({ translations, searchable, attribute, items, isFromSearch }) =>
isFromSearch || (items.length && items.length > 0) ? (
<RefinementList
attribute={attribute}
searchable={searchable}
Expand Down

0 comments on commit 2dde181

Please sign in to comment.