The Autocomplete component is currently implemented with a custom listbox, rather than using a standard component like DropdownMenu. In addition to adding unnecessary code to the bundle, having a custom implementation can introduce subtle differences in styling, keyboard navigation, and accessibility.
What problem does this address?
The
Autocomplete
component is currently implemented with a customlistbox
, rather than using a standard component likeDropdownMenu
. In addition to adding unnecessary code to the bundle, having a custom implementation can introduce subtle differences in styling, keyboard navigation, and accessibility.Inconsistency discovered in https://github.com/WordPress/gutenberg/pull/64294#discussion_r1705957965
What is your proposed solution?
Refactor the component to use DropdownMenu (possibly DropdownMenuV2).
Ideally, we should first figure out a way to make this component testable in Storybook (related: #25715).