Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@
"url": "https://github.com/souhe/reactScrollbar/issues"
},
"homepage": "https://github.com/souhe/reactScrollbar"
}
}
14 changes: 7 additions & 7 deletions src/js/ScrollArea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export default class ScrollArea extends React.Component {
};

this.scrollArea = {
refresh: () => {
this.setSizesToState();
},
refresh: () => {
this.setSizesToState();
},
scrollTop: () => {
this.scrollTop();
},
Expand Down Expand Up @@ -370,10 +370,10 @@ export default class ScrollArea extends React.Component {
}

computeSizes() {
let realHeight = this.content.offsetHeight;
let containerHeight = this.wrapper.offsetHeight;
let realWidth = this.content.offsetWidth;
let containerWidth = this.wrapper.offsetWidth;
let realHeight = (this.content) ? this.content.offsetHeight : 0;
let containerHeight = (this.wrapper) ? this.wrapper.offsetHeight : 0;
let realWidth = (this.content) ? this.content.offsetWidth : 0;
let containerWidth = (this.content) ? this.wrapper.offsetWidth : 0;

return {
realHeight: realHeight,
Expand Down