gfse: prevent scrolling during drag-and-drop on iOS

Applies to webkit-based browsers on other touch-based platforms too
This commit is contained in:
Thomas Hallgren
2019-01-21 21:18:01 +01:00
parent 71307d6518
commit a40130ddc4

View File

@@ -132,8 +132,10 @@ function initialize_sorting(tagList,classList) {
elem.style.zIndex=0;
move_element(elem,0,0);
setDragHandlers(null,null)
preventScroll=false;
return false;
}
preventScroll=true;
setDragHandlers(dragMove,dragEnd)
return false;
}
@@ -146,8 +148,13 @@ function initialize_sorting(tagList,classList) {
//var jsdebug=debug;
//https://stackoverflow.com/questions/49500339/cant-prevent-touchmove-from-scrolling-window-on-ios
var preventScroll=false;
function pd(e) {if(preventScroll) e.preventDefault()}
function init() {
setStartHandler(mousedown)
document.addEventListener("touchmove",pd,{passive:false})
//var d=element("javascriptdebug");
//if(d) jsdebug=function(msg) { d.innerHTML=msg; }
}