Open guoyunhe opened 1 year ago
You're right, the fullWidth
prop on the Autocomplete seems to only add the .MuiAutocomplete-fullWidth
class on the root element and does not control the actual input.
This was done in #19805. @oliviertassinari, the description of the PR doesn't explain why this was done this way. Do you still remember anything about this PR?
Changing this behavior will break existing layouts. We can work on it when preparing v6.
Duplicates
Latest version
Steps to reproduce ๐น
Link to live example: https://stackblitz.com/edit/react-zc5u5j?file=demo.js
Steps:
<Autocomplete/>
with a<TextField/>
as inner input.Current behavior ๐ฏ
The
<Autocomplete/>
is full width, even if I didn't specify fullwidth prop.After inspecting the props of
<TextField/>
, I found that<Autocomplete/>
always passfullwidth={true}
to inner input component, which is unexpected.Expected behavior ๐ค
It should not be fullwidth if I din't tell it to be. This makes the component more predictable.
Context ๐ฆ
No response
Your environment ๐
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```npx @mui/envinfo