Skip to content

Commit

Permalink
[data grid] SingleSelect columns stopped getting the label correctly …
Browse files Browse the repository at this point in the history
…for "is any of" starting from 7.0.0-alpha.7 (#11939)

Co-authored-by: jasmyneokudo <[email protected]>
Co-authored-by: seunexplicit <[email protected]>
  • Loading branch information
3 people authored Feb 19, 2024
1 parent 0da71c1 commit 007fc44
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingl
if (!Array.isArray(item.value)) {
return [];
}
return item.value;
}, [item.value]);

return item.value.reduce<ValueOptions[]>((acc, value) => {
const resolvedValue = resolvedValueOptions.find((v) => getOptionValue(v) === value);
if (resolvedValue != null) {
acc.push(resolvedValue);
}
return acc;
}, [] as ValueOptions[]);
}, [getOptionValue, item.value, resolvedValueOptions]);

const handleChange = React.useCallback<
NonNullable<AutocompleteProps<ValueOptions, true, false, true>['onChange']>
Expand Down

0 comments on commit 007fc44

Please sign in to comment.