diff --git a/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js b/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js index 264f0ee8f67ce2..9eeadda0cb3001 100644 --- a/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js +++ b/packages/mui-base/src/useAutocomplete/useAutocomplete.test.js @@ -31,7 +31,12 @@ describe('useAutocomplete', () => { {groupedOptions.length > 0 ? ( ) : null} diff --git a/packages/mui-material/src/Autocomplete/Autocomplete.js b/packages/mui-material/src/Autocomplete/Autocomplete.js index a81286fc3615ea..48f8af764d6c8f 100644 --- a/packages/mui-material/src/Autocomplete/Autocomplete.js +++ b/packages/mui-material/src/Autocomplete/Autocomplete.js @@ -552,14 +552,18 @@ const Autocomplete = React.forwardRef(function Autocomplete(inProps, ref) { if (renderTags) { startAdornment = renderTags(value, getCustomizedTagProps, ownerState); } else { - startAdornment = value.map((option, index) => ( - - )); + startAdornment = value.map((option, index) => { + const { key, ...customTagProps } = getCustomizedTagProps({ index }); + return ( + + ); + }); } } diff --git a/packages/mui-material/src/Autocomplete/Autocomplete.test.js b/packages/mui-material/src/Autocomplete/Autocomplete.test.js index 9446aa9aed4a29..226ae973423958 100644 --- a/packages/mui-material/src/Autocomplete/Autocomplete.test.js +++ b/packages/mui-material/src/Autocomplete/Autocomplete.test.js @@ -638,7 +638,10 @@ describe('', () => { renderTags={(value, getTagProps) => value .filter((x, index) => index === 1) - .map((option, index) => ) + .map((option, index) => { + const { key, ...tagProps } = getTagProps({ index }); + return ; + }) } onChange={handleChange} renderInput={(params) => }