Skip to content

Commit 3c28c32

Browse files
authored
Merge pull request #117 from styleket/firefox-scrollsize-fix
Compatible scrollWidth, scrollHeight for Firefox and IE
2 parents b4de209 + f5300ca commit 3c28c32

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

react-list.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export default class extends Component {
147147
const {scrollParent} = this;
148148
const {axis} = this.props;
149149
return scrollParent === window ?
150-
document.body[SCROLL_SIZE_KEYS[axis]] :
150+
Math.max(document.body[SCROLL_SIZE_KEYS[axis]], document.documentElement[SCROLL_SIZE_KEYS[axis]]) :
151151
scrollParent[SCROLL_SIZE_KEYS[axis]];
152152
}
153153

react-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
var scrollParent = this.scrollParent;
229229
var axis = this.props.axis;
230230

231-
return scrollParent === window ? document.body[SCROLL_SIZE_KEYS[axis]] : scrollParent[SCROLL_SIZE_KEYS[axis]];
231+
return scrollParent === window ? Math.max(document.body[SCROLL_SIZE_KEYS[axis]], document.documentElement[SCROLL_SIZE_KEYS[axis]]) : scrollParent[SCROLL_SIZE_KEYS[axis]];
232232
}
233233
}, {
234234
key: 'hasDeterminateSize',

0 commit comments

Comments
 (0)