-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Dropdown doesn't pay attention to the viewport #618
Comments
Auto-detection of available viewport height is something that’s out-of-the-scope of current dropdown implementation, but wondering if we should allow “dropup” style (e.g. with |
@asudoh could you elaborate on or add a picture of what a dropup looks like? I'm not familiar with it. Thanks! |
@tay-aitken I think he just means having the option for the dropdown to open up instead of down. |
I wouldn't recommend this pattern. It's not something I've seen and I worry it will cause confusion with users, who typically expect the Dropdown to open down. |
Material Design actually recommends this if you scroll down on this page.
https://material.io/guidelines/components/menus.html#menus-simple-menus And you can see it in action here on this React implementation of material That being said, implementing something like this where it is aware of the screen edge is definitely not simple and out of scope the way dropdowns are currently built. I'm not sure just giving the option to change the styles is the best approach. |
@tay-aitken Thoughts on implementing this pattern for just the Basic Dropdown, but all others, the drawer opens on bottom? |
I think @asudoh's solution is a nice meet-in-the-middle. We can support this variation via css styles ( |
…m#697) This change also moves the focus back to the trigger button when the menu body loses focus. Refs carbon-design-system#618.
Detailed description
If the popup for a Select or Datepicker wouldn't fit in the viewport, they are moved/adjusted appropriately so they fit.
This is not the case for DropDown, Combobox, or MultiSelect. If you place them at the bottom of a page, the will cause a scrollbar to get added to the page when the popup is opened and then disappear when it's closed.
For Tooltip, you can specify the position but that is not helpful if you don't know where the tooltip will appear on the page.
Our product allows the admins to put their controls where ever they want, so we need them all to work well at the bottom of the page.
Steps to reproduce the issue
Place a Dropdown near the bottom of the page. See the scrollbars show up on the page, even though there is plenty of room to display the dropdown elsewhere.
Additional information
Add labels
Please choose the appropriate label(s) from our existing label list to ensure that your issue is properly categorized. This will help us to better understand and address your issue.
The text was updated successfully, but these errors were encountered: