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

selectableRowsHideCheckboxes hides check boxes but still takes up space #1591

Closed
aryo opened this issue Nov 30, 2020 · 4 comments · Fixed by #1601
Closed

selectableRowsHideCheckboxes hides check boxes but still takes up space #1591

aryo opened this issue Nov 30, 2020 · 4 comments · Fixed by #1601
Labels

Comments

@aryo
Copy link

aryo commented Nov 30, 2020

When selectableRowsHideCheckboxes is set to true, the first column containing the check boxes is still there (even though the checkboxes are no longer visible).

Is there a way to remove the whole column? or at least make it take up 0 space?

Expected Behavior

Checkbox column does not take up space

Current Behavior

Checkbox column takes up space even though checkboxes are hidden

Steps to Reproduce (for bugs)

https://codesandbox.io/s/muidatatables-custom-toolbar-kwemy?file=/index.js

Play around with selectableRowsHideCheckboxes option

Your Environment

Tech Version
Material-UI 4.11.0
MUI-datatables 3.7.1
React 16.13.1
browser
etc
@aryo
Copy link
Author

aryo commented Nov 30, 2020

I've had to override the theme based on whether the selectableRowsHideCheckboxes option is true to get this to work. Ideally this should happen out of the box if the option is true.

MUIDataTableSelectCell: {
  root: {
    display: "none"
  }
}

@wdh2100 wdh2100 added the bug label Dec 2, 2020
@wdh2100
Copy link
Collaborator

wdh2100 commented Dec 2, 2020

{selectableOn !== 'none' && selectableRowsHideCheckboxes !== true && renderCheckBox()}

I think it's in the wrong place.

wdh2100 added a commit that referenced this issue Dec 10, 2020
- Refactoring TableSelectCell
- Refactoring ExpandButton
wdh2100 added a commit that referenced this issue Dec 10, 2020
@wdh2100
Copy link
Collaborator

wdh2100 commented Dec 10, 2020

@aryo

Fixed 3.7.2

@aryo
Copy link
Author

aryo commented Dec 10, 2020

@wdh2100 Good stuff!

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

Successfully merging a pull request may close this issue.

2 participants