Skip to content

Commit c6d2a8c

Browse files
authored
Merge pull request #27 from henrybuilt/misc-bug-fixes
subclassing row or component instead of a row now works
2 parents a1057d5 + 7bee7ac commit c6d2a8c

File tree

4 files changed

+3876
-9
lines changed

4 files changed

+3876
-9
lines changed

dist/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@
311311
}, {
312312
key: 'setScrollBarDims',
313313
value: function setScrollBarDims() {
314-
var width = this.getNodeSize(this.dom.bodyTable.firstChild).width;
314+
var width = this.getNodeSize(this.dom.bodyTable.firstChild).width + this.dom.stickyColumn.offsetWidth;
315315
this.dom.xScrollbar.firstChild.style.width = width + 'px';
316316

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

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

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

501506
var stickyCornerRows = this.getStickyCornerRows(rows);
502507
var stickyColumnRows = this.getStickyColumnRows(rows);

0 commit comments

Comments
 (0)