Try either replacing (recommended) the touch toolbar (or in addition to it) with the following JS fragment and calling the init() function on $(document).ready(); :
- Please note that you can comment on styles in
#wrapper , they were installed only for overflow testing. - Ideally, you will leave some space from draggable items to scroll without unwanted drag.
Below is a snippet:
$(document).ready(function() { init(); $("#myContainer").sortable({ //your code }) }); function touchHandler(event) { var touch = event.changedTouches[0]; var simulatedEvent = document.createEvent("MouseEvent"); simulatedEvent.initMouseEvent({ touchstart: "mousedown", touchmove: "mousemove", touchend: "mouseup" }[event.type], true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); touch.target.dispatchEvent(simulatedEvent); event.preventDefault(); } function init() { document.addEventListener("touchstart", touchHandler, true); document.addEventListener("touchmove", touchHandler, true); document.addEventListener("touchend", touchHandler, true); document.addEventListener("touchcancel", touchHandler, true); }
---> Screenshot with fragment replacing touch punch <---
---> Screenshot with fragment + touch punch <---
(Both are tested on mobile safaris and chrome, dragging is carried out on the 1st crane)
Syden
source share