-
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
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
packages/components/src/select-control/styles/select-control-styles.ts
Outdated
Show resolved
Hide resolved
}; | ||
|
||
const backCompatMinWidth = ( props: BackCompatMinWidthProps ) => | ||
! props.__nextUnconstrainedWidth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/components/src/select-control/styles/select-control-styles.ts
Outdated
Show resolved
Hide resolved
packages/components/src/select-control/styles/select-control-styles.ts
Outdated
Show resolved
Hide resolved
@ciampo What would we do without you, Marco. Thanks for the 👀 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
This was a tricky one to get right, great job!
It's gratifying to see the steady little steps towards making our components more coherent ⭐
Follow-up to #42460
What?
Refactors the
chevronDown
icon 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 (
suffix
prop & suffix wrapper component). It removes hacks and maintains visual consistency across components.How?
Refactor the implementation to use the
suffix
prop & 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