[Autocomplete] Use ul
element for the listbox
#44422
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #44264
Explanation
The
ul
element was lost in this PR: #43994. Previously, it was provided via theas
prop:material-ui/packages/mui-material/src/Autocomplete/Autocomplete.js
Lines 560 to 561 in 15ea548
material-ui/packages/mui-material/src/Autocomplete/Autocomplete.js
Line 685 in 15ea548
But after #43994 fix, we failed to maintain it:
material-ui/packages/mui-material/src/Autocomplete/Autocomplete.js
Line 329 in 01c5f34
material-ui/packages/mui-material/src/Autocomplete/Autocomplete.js
Lines 559 to 560 in 01c5f34
material-ui/packages/mui-material/src/Autocomplete/Autocomplete.js
Line 686 in 01c5f34
Solution
This PR brings it back by setting
AutocompleteListbox
's element toul
, and adds a test for it.v5: https://codesandbox.io/p/sandbox/pr-44422-v5-x2ff5z
Before: https://codesandbox.io/p/sandbox/pr-44422-before-l66t9p
After: https://codesandbox.io/p/sandbox/pr-44422-after-cx66k3