I don't think the event.preventDefault() comment in jquery.ui.touch-punch.js works longer. I tried the same solution and found that jQuery UI draggable blocked the default vertical scroll behavior - even if the element is set to move only along the x axis.
The solution that worked for me was to measure any changes in the vertical position of the cursor and use window.scrollBy to manually scroll the window by the same amount:
var firstY = null; var lastY = null; var currentY = null; var vertScroll = false; var initAdjustment = 0; // record the initial position of the cursor on start of the touch jqDraggableItem.on("touchstart", function(event) { lastY = currentY = firstY = event.originalEvent.touches[0].pageY; }); // fires whenever the cursor moves jqDraggableItem.on("touchmove", function(event) { currentY = event.originalEvent.touches[0].pageY; var adjustment = lastY-currentY; // Mimic native vertical scrolling where scrolling only starts after the // cursor has moved up or down from its original position by ~30 pixels. if (vertScroll == false && Math.abs(currentY-firstY) > 30) { vertScroll = true; initAdjustment = currentY-firstY; } // only apply the adjustment if the user has met the threshold for vertical scrolling if (vertScroll == true) { window.scrollBy(0,adjustment + initAdjustment); lastY = currentY + adjustment; } }); // when the user lifts their finger, they will again need to meet the // threshold before vertical scrolling starts. jqDraggableItem.on("touchend", function(event) { vertScroll = false; });
This will look exactly like scrolling on a touch device.
source share