Material-ui: Table problems when removing checkboxes

Created on 8 Mar 2016  路  2Comments  路  Source: mui-org/material-ui

I noticed some layout oddness when I disable checkboxes in the Table (and related) components.

title_here

If I manually delete that upper left cell where the select-all checkbox normally goes, everything looks much better and aligns properly. Am I missing an option somewhere to correct this?

On a related note, it seems particularly tricky to disable checkboxes as it takes several options to do so. I feel like maybe there should be a single boolean on the Table component that disables checkboxes completely. In fact, IMO it should be off by default: I'd say in most cases, tabular data is being displayed for informational purposes and not for user interaction.

question

Most helpful comment

Aha. adjustForCheckbox.. I missed that! So just to disable checkboxes, I had to specify three options:

  • adjustForCheckbox and displaySelectAll on TableHeader
  • displayRowCheckbox on TableBody

Would it not be easier to just have two possible options for the table:

<Table displayCheckboxes displaySelectAll>

And then if the user needs to disable a checkbox in a specific row, they can override that:

<TableRow displayCheckbox={false}>

All 2 comments

Aha. adjustForCheckbox.. I missed that! So just to disable checkboxes, I had to specify three options:

  • adjustForCheckbox and displaySelectAll on TableHeader
  • displayRowCheckbox on TableBody

Would it not be easier to just have two possible options for the table:

<Table displayCheckboxes displaySelectAll>

And then if the user needs to disable a checkbox in a specific row, they can override that:

<TableRow displayCheckbox={false}>

@ffxsam I think in the near future we're going to revisit the table, would love your input when we open that discussion :+1:

Was this page helpful?
0 / 5 - 0 ratings