diff --git a/iron-swipeable-pages.html b/iron-swipeable-pages.html
index d1b3734..95e3fa6 100644
--- a/iron-swipeable-pages.html
+++ b/iron-swipeable-pages.html
@@ -127,7 +127,7 @@
},
/**
- * The maximum global CSS transition duration applied if swiping involves more than one
+ * The maximum global CSS transition duration applied if swiping involves more than one
* page transition using selection instead of manual swiping.
*/
maximumTransitionDuration: {
@@ -185,7 +185,6 @@
return;
// TODO PG: check for webkit 'webkitTransitionEnd'
this.listen(page, 'transitionend', '_onTransitionEnd');
- console.log("adding page!");
},
_removePage: function(page) {
@@ -193,13 +192,12 @@
return;
// TODO PG: check for webkit 'webkitTransitionEnd'
this.unlisten(page, 'transitionend', '_onTransitionEnd');
- console.log("removing page!");
},
_onDomChange: function(event) {
// something might have change inside a template helper, e.g. `dom-if`
// so we should call forceSynchronousItemUpdate() to update the item list
- // since it is not performance optimal, this is an opt-in option and we raise a
+ // since it is not performance optimal, this is an opt-in option and we raise a
// warning if this occurs and the option is not enabled
if (this.forceUpdate) {
this.forceSynchronousItemUpdate();
@@ -242,6 +240,8 @@
this._setUpSwipePages();
this._animatePages(trackData.dx);
this._switchPageIfNecessary(trackData.dx);
+ // Prevent regular touchmove event (disables vertical scroll)
+ window.addEventListener('touchmove', this._preventTouchMove);
},
_trackMove: function(trackData) {
@@ -271,6 +271,12 @@
} else {
this._animatePages(0);
}
+ // Enable regular touchmove event (enables vertical scroll again)
+ window.removeEventListener('touchmove', this._preventTouchMove);
+ },
+
+ _preventTouchMove: function (e) {
+ return e && e.preventDefault();
},
_onIronDeselectItem: function(event) {
@@ -360,7 +366,7 @@
}
},
- // this function is useful if only 2 pages are available and we need to switch the next/previous page
+ // this function is useful if only 2 pages are available and we need to switch the next/previous page
// on the left/right side depending on the direction of the swipe given with `dx`
_switchPageIfNecessary: function(dx) {
if (this._leftCandidate && this._rightCandidate && this._leftCandidate === this._rightCandidate) {