fix: issue with clear filter option not working for filter groups in create view modal. (#3081)

This commit is contained in:
Prateek Shourya 2023-12-11 22:23:20 +05:30 committed by GitHub
parent c7cad452ab
commit 3b12332704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,14 @@ export const ProjectViewForm: React.FC<Props> = observer(({ handleFormSubmit, ha
// for removing filters from a key
const handleRemoveFilter = (key: keyof IIssueFilterOptions, value: string | null) => {
if (!value) return;
// If value is null then remove all the filters of that key
if (!value) {
setValue("query_data", {
...selectedFilters,
[key]: null,
});
return;
}
const newValues = selectedFilters?.[key] ?? [];