Skip to content

Commit

Permalink
Merge pull request #27 from henrybuilt/misc-bug-fixes
Browse files Browse the repository at this point in the history
subclassing row or component instead of a row now works
  • Loading branch information
maxhudson authored Apr 9, 2018
2 parents a1057d5 + 7bee7ac commit c6d2a8c
Show file tree
Hide file tree
Showing 4 changed files with 3,876 additions and 9 deletions.
11 changes: 8 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@
}, {
key: 'setScrollBarDims',
value: function setScrollBarDims() {
var width = this.getNodeSize(this.dom.bodyTable.firstChild).width;
var width = this.getNodeSize(this.dom.bodyTable.firstChild).width + this.dom.stickyColumn.offsetWidth;
this.dom.xScrollbar.firstChild.style.width = width + 'px';

this.xScrollSize = this.dom.xScrollbar.offsetHeight - this.dom.xScrollbar.clientHeight;

var height = this.getNodeSize(this.dom.bodyTable).height + this.xScrollSize - this.dom.stickyHeader.offsetHeight;
var height = this.dom.bodyTable.offsetHeight + this.dom.stickyHeader.offsetHeight;
this.dom.yScrollbar.firstChild.style.height = height + 'px';

this.yScrollSize = this.dom.yScrollbar.offsetWidth - this.dom.yScrollbar.clientWidth;
Expand Down Expand Up @@ -496,7 +496,12 @@
}, {
key: 'render',
value: function render() {
var rows = _react2.default.Children.toArray(this.props.children);
//This is probably sub-optimal because render only needs
//to be called for react components that are sub-classed
//and don't have props.children that are <Cell>s
var rows = _react2.default.Children.toArray(this.props.children).map(function (row) {
return new row.type(row.props).render(); // eslint-disable-line new-cap
});

var stickyCornerRows = this.getStickyCornerRows(rows);
var stickyColumnRows = this.getStickyColumnRows(rows);
Expand Down
Loading

0 comments on commit c6d2a8c

Please sign in to comment.