@@ -69,10 +69,14 @@ function rangeSlider({
69
69
max
70
70
} ;
71
71
} ,
72
- _refine ( helper , newValues ) {
72
+ _refine ( helper , stats , newValues ) {
73
73
helper . clearRefinements ( facetName ) ;
74
- helper . addNumericRefinement ( facetName , '>=' , newValues [ 0 ] ) ;
75
- helper . addNumericRefinement ( facetName , '<=' , newValues [ 1 ] ) ;
74
+ if ( newValues [ 0 ] > stats . min ) {
75
+ helper . addNumericRefinement ( facetName , '>=' , newValues [ 0 ] ) ;
76
+ }
77
+ if ( newValues [ 1 ] < stats . max ) {
78
+ helper . addNumericRefinement ( facetName , '<=' , newValues [ 1 ] ) ;
79
+ }
76
80
helper . search ( ) ;
77
81
} ,
78
82
render ( { results, helper, templatesConfig} ) {
@@ -101,7 +105,7 @@ function rangeSlider({
101
105
Template = { bindProps ( Template , templateProps ) }
102
106
hideWhenNoResults = { hideWhenNoResults }
103
107
hasResults = { stats . min !== null && stats . max !== null }
104
- onChange = { this . _refine . bind ( this , helper ) }
108
+ onChange = { this . _refine . bind ( this , helper , stats ) }
105
109
tooltips = { tooltips }
106
110
/> ,
107
111
containerNode
0 commit comments