Skip to content
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

[material-ui] Duplicate class names for components #42103

Open
xettri opened this issue May 3, 2024 · 0 comments
Open

[material-ui] Duplicate class names for components #42103

xettri opened this issue May 3, 2024 · 0 comments
Assignees
Labels
package: material-ui Specific to @mui/material status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: question Community support but can be turned into an improvement

Comments

@xettri
Copy link

xettri commented May 3, 2024

Steps to reproduce

MUI-5

I've noticed duplicate class names being added to components, such as MuiButton-root, MuiButton-contained, MuiButton-containedPrimary, MuiButton-sizeMedium, MuiButton-containedSizeMedium and MuiButton-colorPrimary. This duplication occurs within the HTML elements, like the button example below. I'm unsure whether this is a bug or expected behavior. Can you clarify whether this duplication is intentional?
Similar we can see in almost all component like Checkbox, Select etc

<button
  class="MuiButtonBase-root MuiButton-root MuiButton-contained
    MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium
    MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary
    MuiButton-sizeMedium MuiButton-containedSizeMedium
    MuiButton-colorPrimary css-1hw9j7s"
  tabindex="0"
  type="button"
>
  Contained<span class="MuiTouchRipple-root css-w0pj6f"></span>
</button>

Link to live example: This can be seen in MUI-5 doc pages as well
https://mui.com/material-ui/react-button/

Current behavior

Duplicates values of classes in html

Expected behavior

No duplicate values should be there (if they are not intentionally added)

Your environment

npx @mui/envinfo
  System:
    OS: macOS 13.1
  Binaries:
    Node: 16.20.0 - ~/.nvm/versions/node/v16.20.0/bin/node
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.0/bin/npm
    pnpm: 8.15.6 - ~/.nvm/versions/node/v16.20.0/bin/pnpm
  Browsers:
    Chrome: Not Found
    Edge: Not Found
    Safari: 16.2
  npmPackages:
    @types/react: ^18.2.47 => 18.2.65 
    typescript: ^5.3.3 => 5.4.2 

Search keywords: Duplicate class

@xettri xettri added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 3, 2024
@zannager zannager added support: question Community support but can be turned into an improvement package: material-ui Specific to @mui/material labels May 3, 2024
@danilo-leal danilo-leal changed the title Duplicate class names for components [material-ui] Duplicate class names for components May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: material-ui Specific to @mui/material status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants