[Autocomplete & TextField]: Autocomplete and Textfield have different heights when using variant='filled' and hiddenLabel #34744
Labels
bug 🐛
Something doesn't work
component: autocomplete
This is the name of the generic UI component, not the React module!
Duplicates
Latest version
Steps to reproduce 🕹
Steps:
variant='filled'
andhiddenLabel
andsize='small
size='small'
andrenderInput={(props) => <TextField {...props} hiddenLabel variant="filled" />
(the behavior occurs whether or not the props are added to TextField)Sandbox
Current behavior 😯
Both the text field and the autocomplete are using the same Textfield variants and sizes, yet they render with different heights. This causes significant layout alignment issues when using textfields together with autocompletes. For example, entering a stroke color into the textField and then selecting a stroke width from the autocomplete side by side.
Expected behavior 🤔
With the TextFields having the same props, the expected behavior is that they render to the same height.
Context 🔦
I just want to render two flex columns inside a flex container with a gap such that each column has a title, then a gap beneath it, and then the autocomplete or the textfield. The flex layout works, but the autocomplete and textfield render to different heights, creating an offset layout in my application. I would expect both the textfield and autocomplete to render to the same height so that my UI is consistent. I tried modifying the height of the autocomplete to fill the container to no avail.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: