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

[DataGrid] Add key prop to GridFilterInputMultipleValue #14302

Merged
merged 3 commits into from
Aug 29, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps)
value={filterValueState}
onChange={handleChange}
renderTags={(value, getTagProps) =>
value.map((option, index) => (
<rootProps.slots.baseChip
variant="outlined"
size="small"
label={option}
{...getTagProps({ index })}
/>
))
value.map((option, index) => {
const { key, ...tagProps } = getTagProps({ index });
return (
<rootProps.slots.baseChip
key={key}
variant="outlined"
size="small"
label={option}
{...tagProps}
/>
);
})
Comment on lines +68 to +79
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is taken from

renderTags={(value, getTagProps) =>
value.map((option, index) => {
const { key, ...tagProps } = getTagProps({ index });
return (
<rootProps.slots.baseChip
key={key}
variant="outlined"
size="small"
label={getOptionLabel(option)}
{...tagProps}
/>

}
renderInput={(params) => (
<rootProps.slots.baseTextField
Expand Down
Loading