diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c303d46c..8910e3f42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ You can also check the [release page](https://github.com/visualize-admin/visuali - Added a new group of charts – Combo charts – that includes multi-measure line, dual-axis line and column-line charts - Added a way to edit and remove charts for logged in users - Improved user profile page +- Fixes + - It's now again possible to enable interactive segment filters # [3.22.9] - 2023-10-06 diff --git a/app/configurator/interactive-filters/interactive-filters-config-state.tsx b/app/configurator/interactive-filters/interactive-filters-config-state.tsx index 47ce3fee5..4647afe38 100644 --- a/app/configurator/interactive-filters/interactive-filters-config-state.tsx +++ b/app/configurator/interactive-filters/interactive-filters-config-state.tsx @@ -15,14 +15,18 @@ export const useInteractiveFiltersToggle = (target: "legend") => { const chartConfig = getChartConfig(state); const onChange = useEvent((e: ChangeEvent) => { if (chartConfig.interactiveFiltersConfig?.[target]) { - chartConfig.interactiveFiltersConfig[target].active = - e.currentTarget.checked; - } + const newConfig = produce( + chartConfig.interactiveFiltersConfig, + (draft) => { + draft[target].active = e.currentTarget.checked; + } + ); - dispatch({ - type: "INTERACTIVE_FILTER_CHANGED", - value: chartConfig.interactiveFiltersConfig, - }); + dispatch({ + type: "INTERACTIVE_FILTER_CHANGED", + value: newConfig, + }); + } }); const stateValue = get(