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

Provide isScrollbarVisible for table #1539

Merged
merged 1 commit into from
Sep 29, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/table/table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ let Table = React.createClass({
return (
<div className="mui-table-wrapper" style={styles.tableWrapper}>
{headerTable}
<div className="mui-body-table" style={styles.bodyTable}>
<table className={classes} style={mergedTableStyle}>
<div className="mui-body-table" style={styles.bodyTable} ref="tableDiv">
<table className={classes} style={mergedTableStyle} ref="tableBody">
{inlineHeader}
{inlineFooter}
{tBody}
Expand All @@ -148,6 +148,13 @@ let Table = React.createClass({
);
},

isScrollbarVisible() {
const tableDivHeight = React.findDOMNode(this.refs.tableDiv).clientHeight;
const tableBodyHeight = React.findDOMNode(this.refs.tableBody).clientHeight;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The findDOMNode call would need to be changed whenever we move to react 0.14


return tableBodyHeight > tableDivHeight;
},

_createTableHeader(base) {
return React.cloneElement(
base,
Expand Down