Skip to content

Commit

Permalink
[fixed] Fix scroll top calculation for overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Jia committed May 24, 2015
1 parent ed3f641 commit 66e41a4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/OverlayTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,21 @@ const OverlayTrigger = React.createClass({

_getContainerDimensions() {
const containerNode = this.getContainerDOMNode();
let width, height;
let width, height, scroll;

if (containerNode.tagName === 'BODY') {
width = window.innerWidth;
height = window.innerHeight;
scroll =
domUtils.ownerDocument(containerNode).documentElement.scrollTop ||
containerNode.scrollTop;
} else {
width = containerNode.offsetWidth;
height = containerNode.offsetHeight;
scroll = containerNode.scrollTop;
}

return {
width, height,
scroll: containerNode.scrollTop
};
return {width, height, scroll};
},

getPosition() {
Expand Down

0 comments on commit 66e41a4

Please sign in to comment.