Skip to content

Commit

Permalink
Remove lock in CategoryWidget if selected categories change (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
padawannn authored Dec 1, 2021
1 parent 84a550c commit 0eee58f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Not released

- Fix CategoryWidget values during animation [#230](https://github.com/CartoDB/carto-react/pull/230)
- Remove lock in CategoryWidget if selected categories change [#231](https://github.com/CartoDB/carto-react/pull/231)

## 1.1.1 (2021-11-23)

Expand Down
2 changes: 1 addition & 1 deletion packages/react-redux/src/slices/cartoSlice.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function setBasemap(
export function addFilter(
filter: Filter
): {
type: CartoActions.ADD_LAYER;
type: CartoActions.ADD_FILTER;
payload: Filter;
};

Expand Down
6 changes: 6 additions & 0 deletions packages/react-ui/src/widgets/CategoryWidgetUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ function CategoryWidgetUI(props) {
[maxValue]
);

useEffect(() => {
if (selectedCategories.length === 0) {
setBlockedCategories([]);
}
}, [selectedCategories]);

useEffect(() => {
if (data) {
// Ranking
Expand Down

0 comments on commit 0eee58f

Please sign in to comment.