(Custom)SelectControl: Refresh and refactor chevron#42962
Conversation
|
Size Change: +3.44 kB (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
No, the default still remains 30px. I'm inching closer to getting 40px variants enabled in the sidebar though. I'm planning on flipping the switch beginning with the Typography panel in the Global Styles sidebar, since that's pretty contained. |
There was a problem hiding this comment.
Thank you for working on this!
Currently, when I try to click on the chevron icon, the dropdowns (both in SelectControl and CustomSelectControl) don't react to the pointer events (clicking on the rest of the input works)
Also, the layout of SelectControl looks a bit broken when switching to "Wordpress (common/forms)" in the global CSS switcher
| }; | ||
|
|
||
| const backCompatMinWidth = ( props: BackCompatMinWidthProps ) => | ||
| ! props.__nextUnconstrainedWidth |
There was a problem hiding this comment.
It looks like InputBaseWithBackCompatMinWidth never receives the __nextUnconstrainedWidth prop in packages/components/src/custom-select-control/index.js
There was a problem hiding this comment.
Lol, I like how this still accidentally works even without the correct prop 😂 (Also how do people code without end-to-end typescript checking...)
# Conflicts: # packages/components/CHANGELOG.md # packages/components/src/custom-select-control/index.js
Great one, thank you. Fixed in f5f5639.
Congrats, this observation caught two pre-existing forms.css problems:
Thanks for the great review @ciampo! All feedback is now addressed. |
|
@ciampo What would we do without you, Marco. Thanks for the 👀 ! |



Follow-up to #42460
What?
Refactors the
chevronDownicon in SelectControl/CustomSelectControl so the implementation is clean and the visual is consistent.Visual changes
@jasmussen Are we happy with the size of the icon? And the spacing before and after it? Let me know if you have tweaks.
Why?
We now have a clean way to implement the chevron (
suffixprop & suffix wrapper component). It removes hacks and maintains visual consistency across components.How?
Refactor the implementation to use the
suffixprop & suffix wrapper component.Testing Instructions
npm run storybook:dev✅ Works in RTL
✅ Width behavior is maintained for CustomSelectControl. (130px wide by default, and grows when the label is long)
Screenshots or screencast
Here's a video of all the size variants (24, 30, 36, 40):
CleanShot.2022-08-04.at.14.51.44.mp4