Skip to content

Commit

Permalink
fix(numericselector): default value can be undefined (#3139)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobylito authored Sep 24, 2018
1 parent ef731cc commit 39d22f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/connectors/numeric-selector/connectNumericSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,14 @@ export default function connectNumericSelector(renderFn, unmountFn) {
.addNumericRefinement(attributeName, operator, value);
}

return searchParameters
.clearRefinements(attributeName)
.addNumericRefinement(attributeName, operator, options[0].value);
const firstItemValue = options[0] && options[0].value;
if (typeof firstItemValue === 'number') {
return searchParameters
.clearRefinements(attributeName)
.addNumericRefinement(attributeName, operator, options[0].value);
}

return searchParameters;
},

_getRefinedValue(state) {
Expand Down

0 comments on commit 39d22f5

Please sign in to comment.