Skip to content

Commit

Permalink
fix touchmove preventdefault ios 11.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
FL3N authored and FL3N committed Oct 5, 2018
1 parent 95bcf4a commit bf60290
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dist/scroll-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ var bindEvents = function bindEvents(scrollLock) {
});
document.addEventListener('touchmove', function (e) {
return touchmoveEventHandler(e, scrollLock);
}, {
passive: false
});
document.addEventListener('touchend', function (e) {
return touchendEventHandler(e, scrollLock);
Expand Down
2 changes: 1 addition & 1 deletion dist/scroll-lock.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/scroll-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ const touchendEventHandler = (e, scrollLock) => {

const bindEvents = (scrollLock) => {
document.addEventListener('touchstart', (e) => touchstartEventHandler(e, scrollLock));
document.addEventListener('touchmove', (e) => touchmoveEventHandler(e, scrollLock));
document.addEventListener('touchmove', (e) => touchmoveEventHandler(e, scrollLock), {
passive: false
});
document.addEventListener('touchend', (e) => touchendEventHandler(e, scrollLock));
};

Expand Down Expand Up @@ -265,4 +267,4 @@ class ScrollLock {

const scrollLock = new ScrollLock();
export default scrollLock;
module.exports = scrollLock;
module.exports = scrollLock;

0 comments on commit bf60290

Please sign in to comment.