Skip to content

Commit

Permalink
[material-ui][Autocomplete] Use ul element for the listbox (#44422)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai authored Nov 15, 2024
1 parent 2224b22 commit e8e4b79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mui-material/src/Autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ const AutocompleteNoOptions = styled('div', {
})),
);

const AutocompleteListbox = styled('div', {
const AutocompleteListbox = styled('ul', {
name: 'MuiAutocomplete',
slot: 'Listbox',
overridesResolver: (props, styles) => styles.listbox,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ describe('<Autocomplete />', () => {
expect(textbox).to.have.attribute('aria-expanded', 'true');

const listbox = getByRole('listbox');
expect(listbox.tagName.toLowerCase()).to.equal('ul');
expect(textbox).to.have.attribute('aria-controls', listbox.getAttribute('id'));
expect(textbox, 'no option is focused when opened').not.to.have.attribute(
'aria-activedescendant',
Expand Down

0 comments on commit e8e4b79

Please sign in to comment.