Skip to content

Commit

Permalink
Apply scroll listener to all scroll events (#322)
Browse files Browse the repository at this point in the history
Fixes #319
  • Loading branch information
RobbieTheWagner authored Jan 16, 2019
1 parent aebf74b commit 011c236
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ function getElementFromString(element) {
function addStepEventListeners() {
if (typeof this._onScreenChange === 'function') {
window.removeEventListener('resize', this._onScreenChange, false);
window.removeEventListener('scroll', this._onScreenChange, false);
window.removeEventListener('scroll', this._onScreenChange, true);
}

window.addEventListener('resize', this._onScreenChange, false);
window.addEventListener('scroll', this._onScreenChange, false);
window.addEventListener('scroll', this._onScreenChange, true);

const overlay = document.querySelector(`#${elementIds.modalOverlay}`);
// Prevents window from moving on touch.
Expand Down

0 comments on commit 011c236

Please sign in to comment.