Skip to content
Snippets Groups Projects
Commit 1ce7cde6 authored by esikkala's avatar esikkala
Browse files

Slider: do not update when default values

parent ce3780e5
No related branches found
No related tags found
No related merge requests found
......@@ -38,17 +38,20 @@ class SliderFacet extends Component {
}
handleSliderOnChange = values => {
console.log(values)
if (this.props.dataType === 'ISOString') {
values[0] = this.YearToISOString({ year: values[0], start: true });
values[1] = this.YearToISOString({ year: values[1], start: false });
const defaultValues = parseInt(values[0]) === parseInt(this.props.facet.min)
&& parseInt(values[1]) == parseInt(this.props.facet.max);
if (!defaultValues) {
if (this.props.dataType === 'ISOString') {
values[0] = this.YearToISOString({ year: values[0], start: true });
values[1] = this.YearToISOString({ year: values[1], start: false });
}
this.props.updateFacetOption({
facetClass: this.props.facetClass,
facetID: this.props.facetID,
option: this.props.facet.filterType,
value: values
});
}
this.props.updateFacetOption({
facetClass: this.props.facetClass,
facetID: this.props.facetID,
option: this.props.facet.filterType,
value: values
});
}
ISOStringToYear = str => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment