-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Improve CustomSelectControl's usability around max height #49110
Comments
Thank you for the report! While we're not going to be able to drop the As we're starting to gather feedback for a hypothetical new version of |
I hope you'll consider making the sizing/spacing dynamic using |
That's a great point, and definitely something that we could/should take into account at a broader design level (cc @WordPress/gutenberg-design ). Regarding If a consumer doesn't need a custom item design and/or wants a more compact select popover look, |
Definitely on our minds, and good reminder. Nicer query too, than the previous trick used, which was |
Is it worth expanding this ticket to also cover the problematic lack of a minimum height or should I open a new ticket? It seems like they should get solved together. In cases where this control appears at the bottom of a settings sidebar, it can have a height of 0 (the 2px height in the screenshot is from the borders, I believe): |
Gutenberg's CustomSelectControl (the reimplementation of the standard
<select>
control) has a maximum height due to an issue reported in #19751, but this ends up making it require scrolling when it shouldn't really be necessary:CleanShot.2023-03-15.at.13.12.07.mp4
There are two complementary ways this could be addressed.
1) Adjust the max height based on media queries. Right now, it's just a flat 400px. Increasing it based on
@media (min-height: whatever)
is not a silver bullet, but it would help on large displays and/or portrait-oriented displays.12) Make the design more compact. By default, CustomSelectControl only shows 7 or 8 items2, which is far fewer than
<select>
while taking up far more vertical space:The amount of padding and margin2 can definitely be reduced while keeping the control usable3 and legible.
Values I used to create these screenshots in Storybook
SelectControl
:CustomSelectControl
:Footnotes
Setting the max height by calculating the amount of space available for the menu would be ideal, but that's getting a bit complex and anything like that would work best supported by simpler fallbacks like this. ↩
In the actual editor,
margin-bottom: 6px;
is applied to the custom select list items, and this isn't present in Storybook. ↩ ↩2If touch screen usability is the reasoning behind the current values, then they could be moved into a
@media (pointer: coarse)
. ↩The text was updated successfully, but these errors were encountered: