Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Interactive segment filters toggle #1215

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ export const useInteractiveFiltersToggle = (target: "legend") => {
const chartConfig = getChartConfig(state);
const onChange = useEvent((e: ChangeEvent<HTMLInputElement>) => {
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(
Expand Down
Loading