diff --git a/CHANGELOG.md b/CHANGELOG.md index 12661b43a..a7d0a45f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Not released +- Histogram takes into account null values in filters for selected bars [#234](https://github.com/CartoDB/carto-react/pull/234) - Return raw feature data from workers [#225](https://github.com/CartoDB/carto-react/pull/225) ## 1.1.2 (2021-12-01) diff --git a/packages/react-widgets/src/widgets/HistogramWidget.js b/packages/react-widgets/src/widgets/HistogramWidget.js index c88ab8a7f..560b98b75 100644 --- a/packages/react-widgets/src/widgets/HistogramWidget.js +++ b/packages/react-widgets/src/widgets/HistogramWidget.js @@ -65,9 +65,9 @@ function HistogramWidget(props) { const selectedBars = useMemo(() => { return (thresholdsFromFilters || EMPTY_ARRAY) .map(([from, to]) => { - if (typeof from === 'undefined') { + if (typeof from === 'undefined' || from === null) { return 0; - } else if (typeof to === 'undefined') { + } else if (typeof to === 'undefined' || to === null) { return ticks.length - 1; } else { const idx = ticks.indexOf(from);