Skip to content

Conversation

@mirka
Copy link
Member

@mirka mirka commented Jul 15, 2022

Part of #39397
In preparation for #41973

What?

Adds the __next36pxDefaultSize prop to SelectControl for the larger default size.

Why?

The #39397 project is on hold, but this one is necessary for implementing size variants for CustomSelectControl (#42460). Basically, I want both SelectControl and CustomSelectControl to share the underlying styling components, and CustomSelectControl already has a __next36pxDefaultSize flag. So we need to implement the flag on SelectControl for parity.

Testing Instructions

  1. npm run storybook:dev and see the SelectControl story.
  2. __next36pxDefaultSize should only affect the default size. Other size variants should be unaffected.

@mirka mirka added the [Package] Components /packages/components label Jul 15, 2022
@mirka mirka requested a review from ajitbohra as a code owner July 15, 2022 07:48
@mirka mirka self-assigned this Jul 15, 2022
@mirka mirka requested review from chad1008 and ciampo July 15, 2022 10:10
@ciampo ciampo added [Type] Enhancement A suggestion for improvement. [Feature] UI Components Impacts or related to the UI component system labels Jul 15, 2022
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 🚀

};
}

const style = sizes[ selectSize ] || sizes.default;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which situation is sizes[ selectSize ] returning undefined, so that we have to fallback to the default? (same applies to the similar code change in the sizePaddings mixin)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a courtesy fallback in case a consumer passes an invalid size string.

@mirka mirka merged commit 1de02c1 into trunk Jul 19, 2022
@mirka mirka deleted the select-control-36px branch July 19, 2022 14:03
@github-actions github-actions bot added this to the Gutenberg 13.8 milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants