Skip to content

Commit

Permalink
Merge pull request #23 from henrybuilt/v2-0-1
Browse files Browse the repository at this point in the history
Scrollbars fixed
  • Loading branch information
maxhudson authored Mar 29, 2018
2 parents 6b063d3 + de73767 commit a1057d5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
13 changes: 7 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,20 @@
}, {
key: 'setScrollBarDims',
value: function setScrollBarDims() {
var width = this.getNodeSize(this.dom.bodyTable.firstChild).width;
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;
this.dom.yScrollbar.firstChild.style.height = height + 'px';

this.yScrollSize = this.dom.yScrollbar.offsetWidth - this.dom.yScrollbar.clientWidth;

if (!this.isFirefox) {
this.setScrollBarPaddings();
}

var width = this.getNodeSize(this.dom.bodyTable.firstChild).width;
this.dom.xScrollbar.firstChild.style.width = width + 'px';

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

if (this.xScrollSize) this.dom.xScrollbar.style.height = this.xScrollSize + 1 + 'px';
if (this.yScrollSize) this.dom.yScrollbar.style.width = this.yScrollSize + 1 + 'px';
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-sticky-table",
"version": "2.0.0",
"version": "2.0.1",
"main": "index.js",
"module": "./index.js",
"description": "Dynamically sized fixed header and columns for tables",
Expand Down
13 changes: 7 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,20 @@ class StickyTable extends PureComponent {
* @returns {undefined}
*/
setScrollBarDims() {
var width = this.getNodeSize(this.dom.bodyTable.firstChild).width;
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;
this.dom.yScrollbar.firstChild.style.height = height + 'px';

this.yScrollSize = this.dom.yScrollbar.offsetWidth - this.dom.yScrollbar.clientWidth;

if (!this.isFirefox) {
this.setScrollBarPaddings();
}

var width = this.getNodeSize(this.dom.bodyTable.firstChild).width;
this.dom.xScrollbar.firstChild.style.width = width + 'px';

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

if (this.xScrollSize) this.dom.xScrollbar.style.height = this.xScrollSize + 1 + 'px';
if (this.yScrollSize) this.dom.yScrollbar.style.width = this.yScrollSize + 1 + 'px';
}
Expand Down

0 comments on commit a1057d5

Please sign in to comment.