Skip to content

[DataGrid] Add key prop to GridFilterInputMultipleValue#14302

Merged
MBilalShafi merged 3 commits intomui:masterfrom
sai6855:add-key
Aug 29, 2024
Merged

[DataGrid] Add key prop to GridFilterInputMultipleValue#14302
MBilalShafi merged 3 commits intomui:masterfrom
sai6855:add-key

Conversation

@sai6855
Copy link
Copy Markdown
Member

@sai6855 sai6855 commented Aug 23, 2024

Closes #14299

@sai6855 sai6855 marked this pull request as draft August 23, 2024 10:03
@sai6855 sai6855 changed the title [DataGrid] Add key [DataGrid] Add key prop to GridFilter Aug 23, 2024
@sai6855 sai6855 added the scope: data grid Changes related to the data grid. label Aug 23, 2024
@mui-bot
Copy link
Copy Markdown

mui-bot commented Aug 23, 2024

Deploy preview: https://deploy-preview-14302--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 54252b9

@sai6855 sai6855 changed the title [DataGrid] Add key prop to GridFilter [DataGrid] Add key prop to GridFilterInputMultipleValue.tsx Aug 23, 2024
Comment on lines +68 to +79
value.map((option, index) => {
const { key, ...tagProps } = getTagProps({ index });
return (
<rootProps.slots.baseChip
key={key}
variant="outlined"
size="small"
label={option}
{...tagProps}
/>
);
})
Copy link
Copy Markdown
Member 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}
/>

@sai6855 sai6855 marked this pull request as ready for review August 23, 2024 10:23
@sai6855 sai6855 changed the title [DataGrid] Add key prop to GridFilterInputMultipleValue.tsx [DataGrid] Add key prop to GridFilterInputMultipleValue Aug 23, 2024
@michelengelen michelengelen added the type: bug It doesn't behave as expected. label Aug 23, 2024
@MBilalShafi MBilalShafi changed the title [DataGrid] Add key prop to GridFilterInputMultipleValue [DataGrid] Add key prop to GridFilterInputMultipleValue Aug 29, 2024
Copy link
Copy Markdown
Member

@MBilalShafi MBilalShafi left a comment

Choose a reason for hiding this comment

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

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: data grid Changes related to the data grid. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[data grid] Warning: A props object containing a "key" prop is being spread into JSX

4 participants