diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae476d23..c77a34238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Not released +- Fix histogram bar selection [#384](https://github.com/CartoDB/carto-react/pull/384) + ## 1.3 ### 1.3.0-alpha.5 (2022-04-25) diff --git a/packages/react-widgets/src/widgets/HistogramWidget.js b/packages/react-widgets/src/widgets/HistogramWidget.js index b8e36251c..22143ff79 100644 --- a/packages/react-widgets/src/widgets/HistogramWidget.js +++ b/packages/react-widgets/src/widgets/HistogramWidget.js @@ -102,7 +102,7 @@ function HistogramWidget(props) { if (bars && bars.length) { const thresholds = bars.map((i) => { let left = ticks[i - 1]; - let right = ticks.length !== i + 1 ? ticks[i] : undefined; + let right = ticks.length !== i ? ticks[i] : undefined; return [left, right]; });