You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.1
2) 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
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. ↩↩2
If 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:
While we're not going to be able to drop the 400pxmax-height for the current version of the component, we're about to merge an improvement that allows the max-height to be less than 400px in case the popover meets the viewport edge.
As we're starting to gather feedback for a hypothetical new version of CustomSelectControl, I'd like us to consider allowing consumers of the component to set min-height and max-height for the select popover (either via react props, or CSS rules). cc @WordPress/gutenberg-components
I hope you'll consider making the sizing/spacing dynamic using @media (pointer: coarse)/@media (pointer: fine). That could make it a lot more usable for mouse users while still preserving usability for touch.
consider making the sizing/spacing dynamic using @media (pointer: coarse)/@media (pointer: fine)
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 CustomSelectControl specifically, I'm not sure how much of an impact that would make on the component, since its main purpose will be to allow custom option item designs provided by the consumers of the component.
If a consumer doesn't need a custom item design and/or wants a more compact select popover look, SelectControl is a good alternative.
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: