CustomSelectControl V2 legacy adapter: fix trigger button font size #63131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Part of #55023
Update the font size of the
CustomSelectControl
V2 legacy adapter to use the same underlying logic as V1Why?
V2 legacy adapter should match V1 styles
How?
The V1 implementation re-uses some
SelectControl
styles, which in turn use a utility fromInputControl
to determine the font size.I've updated
CustomSelectControlV2
to use the same utility.Testing Instructions
In Storybook, open
CustomSelectControlV2
legacy adapter examples:16px
regardless of thesize
prop for screens narrower than600px
600px
, the font size is11px
when thesize
issmall
, and13px
otherwiseNote
During my testing, I realised that
CustomSelectControl
V1 has a bug for which the font size doesn't change as it should according to the size for screens wider than600px
— for some reason, thesize
doesn't get correctly passed to thefontSizeStyles
utility, and as a consequence the default font size is always applied (13px
). You can verify the buggy behaviour by settingsize="small"
onCustomSelectControl
V1 and observe how the font size is still13px
instead of11px
.I don't think we should spend time fixing it, since the V1 implementation is soon going away.