Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Autocomplete] Use ul element for the listbox #44422

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading