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

[Table] Horizontal scrolling table body cut off #4396

Closed
ghost opened this issue May 31, 2016 · 3 comments
Closed

[Table] Horizontal scrolling table body cut off #4396

ghost opened this issue May 31, 2016 · 3 comments
Labels
component: table This is the name of the generic UI component, not the React module!

Comments

@ghost
Copy link

ghost commented May 31, 2016

Problem description

When a table has many columns such that they cannot be displayed simultaneously, a horizontal scrollbar appears by default. When using this scrollbar, the header scrolls as expected, but the table body gets cutoff since it's overflow is hidden. Adding `bodyStyle={{height: 'inherit', overflow: 'auto'}} to the Table component results in a second horizontal scrollbar, one which controls the body properly, the other which controls the header.

Steps to reproduce

      <Table>
        <TableHeader>
          <TableRow>
            {this.props.tableHeader.map((col, i) =>
              <TableHeaderColumn style={{ width: 100 }} key={i}>{col}</TableHeaderColumn>
            )}
          </TableRow>
        </TableHeader>
        <TableBody preScanRows={false}>
          {this.props.tableData.map((row, i) => (
            <TableRow key={i}>
              {this.props.tableHeader.map((col, j) => (
                <TableRowColumn style={{ width: 100 }} key={j}>{row[col]}</TableRowColumn>
              ))}
            </TableRow>
          ))}
        </TableBody>
      </Table>

Versions

  • Material-UI: 0.15.0
  • React: 15.0.2
  • Browser: Chrome 50.0.2661.102 (64-bit)

image

@muibot muibot added the Triage label May 31, 2016
@ghost
Copy link
Author

ghost commented May 31, 2016

Sorry for spamming.

It seems that doing <Table bodyStyle={{overflow:'visible'}}> accomplishes what I want.

Perhaps this should be the default though?

@joncursi
Copy link

The solution proposed above does not play well with fixedHeader={true}. The header loses fixed positioning when bodyStyle overflow is set to visible

@oliviertassinari oliviertassinari added the component: table This is the name of the generic UI component, not the React module! label May 16, 2017
@oliviertassinari oliviertassinari changed the title Horizontal scrolling table body cut off [Table] Horizontal scrolling table body cut off May 16, 2017
@oliviertassinari
Copy link
Member

We have been porting the component on the v1-beta branch. We reimplemented it from the ground-up. The horizontal scroll seems to work correctly on the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

4 participants