Skip to content

Commit e15c9b7

Browse files
author
Alexandre Stanislawski
committed
fix(range-slider): fixes bound definition
in the case other component use the same attribute as conjunctive facet. Also updates the version of noUISlider to fix part of the bounds problems.
1 parent 68adc0d commit e15c9b7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"lodash": "^3.10.1",
7575
"react": "^0.14.0",
7676
"react-dom": "^0.14.0",
77-
"react-nouislider": "^1.5.1",
77+
"react-nouislider": "^1.5.2",
7878
"to-factory": "^1.0.0"
7979
},
8080
"license": "MIT"

widgets/range-slider/range-slider.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,16 @@ function rangeSlider({
8383
}
8484
helper.search();
8585
},
86+
getDisjunctiveFacetPosition(results, facetName) {
87+
let facets = results.disjunctiveFacets;
88+
for (let i = 0; facets.length; i++) {
89+
if (facets[i].name === facetName) return i;
90+
}
91+
return -1;
92+
},
8693
render({results, helper, templatesConfig}) {
87-
let stats = results.getFacetStats(attributeName);
88-
94+
let facetPosition = this.getDisjunctiveFacetPosition(results, attributeName);
95+
let stats = results.disjunctiveFacets[facetPosition].stats;
8996
let currentRefinement = this._getCurrentRefinement(helper);
9097

9198
if (stats === undefined) {

0 commit comments

Comments
 (0)