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 f3e1b3e4846606..4ac6b296d79e1e 100644 --- a/packages/mui-material/src/Autocomplete/Autocomplete.js +++ b/packages/mui-material/src/Autocomplete/Autocomplete.js @@ -580,14 +580,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 26852846f74ddd..4a54e94916d388 100644 --- a/packages/mui-material/src/Autocomplete/Autocomplete.test.js +++ b/packages/mui-material/src/Autocomplete/Autocomplete.test.js @@ -668,7 +668,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) => }