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

MuiCheckbox-colorSecondary class mistakenly applied to selectable row checkboxes #792

Closed
patorjk opened this issue Jul 26, 2019 · 1 comment

Comments

@patorjk
Copy link
Collaborator

patorjk commented Jul 26, 2019

This issue is most apparent if you use a later verison of Material UI (I know the lib currently only supports v3, but having the incorrect class may have other side effects). If you use MUI v4 and you hover over a checkbox, you see the secondary color, but when you click the checkbox, you see the primary color:

https://codesandbox.io/s/muidatatables-custom-toolbar-yv860

This mismatch is due to how the library is setting the color for the checkbox. If you inspect the element, you find that "MuiCheckbox-colorSecondary" is being applied. The secondary color is the default if no color is provided to the Checkbox component:

https://v3.material-ui.com/api/checkbox/

The library sets the color using a class override:

https://github.com/gregnb/mui-datatables/blob/master/src/components/TableSelectCell.js#L37

This issue can be fixed if the color is instead set via the Checkbox's "color" attribute.

Expected Behavior

MuiCheckbox-colorPrimary-* class applied to selectable row checkboxes.

Current Behavior

MuiCheckbox-colorSecondary class applied to selectable row checkboxes.

Steps to Reproduce (for bugs)

  1. Right click a selectable row checkbox and inspect it's properties

Your Environment

ClassName mismatch happens regardless of environment.

Tech Version
Material-UI 4.2
MUI-datatables 2.6.4
React 16.8.6
browser Firefox
etc
@gabrielliwerant
Copy link
Collaborator

Should be fixed in 2.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants