Skip to content

Commit

Permalink
Calculate viewport width correctly (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
sardyy authored and snewcomer committed Oct 11, 2018
1 parent 503cd97 commit fc8fa1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/mixins/in-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default Mixin.create({
}

const height = scrollableArea ? scrollableArea.offsetHeight + scrollableArea.getBoundingClientRect().top : window.innerHeight;
const width = scrollableArea ? scrollableArea.offsetWidth : window.innerWidth;
const width = scrollableArea ? scrollableArea.offsetWidth + scrollableArea.getBoundingClientRect().left : window.innerWidth;
const boundingClientRect = element.getBoundingClientRect();

if (boundingClientRect) {
Expand Down

0 comments on commit fc8fa1b

Please sign in to comment.