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 & TextField]: Autocomplete and Textfield have different heights when using variant='filled' and hiddenLabel #34744

Closed
2 tasks done
paulleonartcalvo opened this issue Oct 13, 2022 · 2 comments · Fixed by #35640
Assignees
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@paulleonartcalvo
Copy link

paulleonartcalvo commented Oct 13, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Steps:

  1. Place a textfield with variant='filled' and hiddenLabel and size='small
  2. On the same horizontal axis, place an Autocomplete with size='small' and renderInput={(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
  Browser used: Chrome
  System:
    OS: macOS 12.5.1
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.14.0 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 106.0.5249.103
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.6.1


@paulleonartcalvo paulleonartcalvo added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 13, 2022
@michaldudak michaldudak self-assigned this Oct 13, 2022
@michaldudak michaldudak added component: autocomplete This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 13, 2022
@paulleonartcalvo
Copy link
Author

Hi :)

Has there been any movement on this specific issue? Just trying to circle back to see if i should update my version or not. Thank you!

@michaldudak
Copy link
Member

Hi @paulleonartcalvo, sorry for the late response. I've created a PR that fixes this issue, but I still have to verify if it doesn't break anything else.

@michaldudak michaldudak added the bug 🐛 Something doesn't work label Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants