[RFC] Better consistency between Autocomplete and Select #43979
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
RFC
Request For Comments
What's the problem?
I'm exploring replacing some of our Select components with Autocomplete components (using the default combo box mode). My assumption was that these would look and act more or less the same as Select components, with the added ability to filter the list by typing on the keyboard. However, the components have several differences in appearance and behavior:
elevation
of 8, while Autocomplete gives itsPaper
an elevation of 2).What are the requirements?
Greater consistency and compatibility - avoid noticeable UX differences, unless there are clear reasons for them
What are our options?
Issues 1-3 (differences in modal, focus handling, and positioning) are likely the result of Select's use of Menu and Popover versus Autocomplete's use of Popper. This may be related to #38756.
Items 4-5 and (to some extent) 6 can be handled by changes to props and components, although I personally would appreciate not needing to apply these customizations myself.
Item 8 seems like a desirable difference: the autocomplete element needs to stay visible so the user can see what they're typing, and limiting the height seems perfectly reasonable.
(There may be UX issues I haven't considered that argue against changing any or all of these.)
Proposed solution
Some simple starting changes would include changing Autocomplete's Paper's elevation to 8 to match Popover and changing it to pass
minWidth
instead ofwidth
to the Popper's style.Resources and benchmarks
https://stackblitz.com/edit/react-3apdzs?file=Demo.tsx has a side-by-side comparison of Select and Autocomplete, including a demonstration of some props and component changes to make Autocomplete more like Select.
Customizing Autocomplete width has come up before: #19376
Search keywords:
The text was updated successfully, but these errors were encountered: