Skip to content

[Select] className of input is overwritten if styled Select  #25814

@siriwatknp

Description

@siriwatknp

If styled Select and pass input as props with className specified, the className is not applied as expected.

const TablePaginationSelect = experimentalStyled(
  Select,
  {},
  {
    name: 'MuiTablePagination',
    slot: 'Select',
    overridesResolver: makeOverridesResolver('select'),
  },
)();

// usage
function App() {
  return (
    <TablePaginationSelect
      input={<InputBase className="This is overwritten by emotion" />}
    />
  )
}
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

className is overwritten by emotion

Expected Behavior 🤔

className should not be overwritten

Steps to Reproduce 🕹

Steps:

  1. create styled Select
  2. render the <StyledSelect input={} />
  3. check in devtool, there is no class "This should appear"

Context 🔦

Your Environment 🌎

`npx @material-ui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @material-ui/envinfo` goes here.

Metadata

Metadata

Assignees

Labels

scope: selectChanges related to the select.type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions