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

[Select] Menu hides input field #34338

Closed
2 tasks done
emlai opened this issue Sep 16, 2022 · 5 comments
Closed
2 tasks done

[Select] Menu hides input field #34338

emlai opened this issue Sep 16, 2022 · 5 comments
Labels
component: select This is the name of the generic UI component, not the React module! support: Stack Overflow Please ask the community on Stack Overflow

Comments

@emlai
Copy link
Contributor

emlai commented Sep 16, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

https://codesandbox.io/s/tender-bas-9pzkhx?file=/demo.js

Current behavior 😯

A long dropdown menu is positioned on top of the select input field:

Screen Shot 2022-09-16 at 17 19 39

Expected behavior 🤔

A long dropdown menu can be positioned below the input field, to avoid hiding it:

Screen Shot 2022-09-16 at 17 23 04

Context 🔦

Tried using anchorOrigin and transformOrigin (see codesandbox repro) as per #12208, but they didn't affect anything.

Your environment 🌎

No response

@emlai emlai added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 16, 2022
@ZeeshanTamboli
Copy link
Member

@emlai Adding a maxHeight to the Menu can fix this. Take a look at the updated CodeSandbox.

@ZeeshanTamboli ZeeshanTamboli added component: select This is the name of the generic UI component, not the React module! support: Stack Overflow Please ask the community on Stack Overflow and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 19, 2022
@github-actions
Copy link

👋 Thanks for using MUI Core!

We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.

For support, please check out https://mui.com/getting-started/support/. Thanks!

If you have a question on Stack Overflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.

@emlai
Copy link
Contributor Author

emlai commented Sep 19, 2022

@ZeeshanTamboli Thanks, that worked!

On a related note, Autocomplete has maxHeight: 40vh by default, so it doesn't have this issue. I wonder if Select should have that default as well, for consistent behavior.

@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Sep 19, 2022

On a related note, Autocomplete has maxHeight: 40vh by default, so it doesn't have this issue. I wonder if Select should have that default as well, for consistent behavior.

I am not sure. It could be a breaking change. Feel free to create a new issue if you think so. The other team members will reply on it.

@raccmonteiro
Copy link

@emlai Adding a maxHeight to the Menu can fix this. Take a look at the updated CodeSandbox.

it's a quick fix, not the right solution. In v4 this didn't happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! support: Stack Overflow Please ask the community on Stack Overflow
Projects
None yet
Development

No branches or pull requests

3 participants