[Select] Arrow / caret doesn't scale with theme typography changes #26401
Labels
bug 馃悰
Something doesn't work
component: select
This is the name of the generic UI component, not the React module!
Current Behavior 馃槸
Using a
Select
component with custom theme typography causes arrow / caret to not be vertically centered.Expected Behavior 馃
Making changes to the theme's typography should cause components to render proper styles by default. A user of material UI shouldn't need to modify components out of the box when adjusting the theme.
Steps to Reproduce 馃暪
https://codesandbox.io/s/busy-feather-uoo3t
Steps:
Select
componentSelect
component is not alignedContext 馃敠
Looking into the MUI code, this line appears to be hardcoded to
calc(50% - 12px)
https://github.com/mui-org/material-ui/blob/e526be50c6f80d8044470fdefa65da7d2e0561d2/packages/material-ui/src/NativeSelect/NativeSelectInput.js#L91
To center this absolute item, I the formula is:
calc( 50% - [half the caret height])
. Since theheight: 1em
which is proportional to fontSize, a potential fix would be:calc(50% - .5em)
Your Environment 馃寧
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: