Skip to content

Commit 5455c94

Browse files
committed
Merge branch 'MaaikeB-affix-in-ie10'
2 parents 7bf33d2 + 8776128 commit 5455c94

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/AffixMixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const AffixMixin = {
3838
}
3939

4040
DOMNode = React.findDOMNode(this);
41-
scrollHeight = document.documentElement.offsetHeight;
41+
scrollHeight = domUtils.getDocumentHeight();
4242
scrollTop = window.pageYOffset;
4343
position = domUtils.getOffset(DOMNode);
4444

src/utils/domUtils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ function getOffset(DOMNode) {
7878
};
7979
}
8080

81+
/**
82+
* Get the height of the document
83+
*
84+
* @returns {documentHeight: number}
85+
*/
86+
function getDocumentHeight() {
87+
return Math.max(document.documentElement.offsetHeight, document.height, document.body.scrollHeight, document.body.offsetHeight);
88+
}
89+
8190
/**
8291
* Get elements position
8392
*
@@ -205,6 +214,7 @@ export default {
205214
ownerDocument,
206215
getComputedStyles,
207216
getOffset,
217+
getDocumentHeight,
208218
getPosition,
209219
getSize,
210220
activeElement: getActiveElement,

0 commit comments

Comments
 (0)