Open LufoX11 opened 6 years ago
This is a problem when a touch-drag on the slider handle happens on a scrollbar within in a scrollable element. The touch-drag will cause the element to scroll, and also moves the handle (as it should). The problem is how to prevent the container from scrolling when the intent is just to drag the handle. Setting "touch-action: none" on the drag handle results in the correct behavior in Chrome devtools (although error message still appears). However, the unwanted scroll of the container still occurs on the mobile device (in my case I'm testing on an iPhone 6).
Based on this explanation I think that the line:
let eventOptions = supportsPassive ? { passive: true } : false;
should be amended to:
let eventOptions = supportsPassive ? { passive: false } : false;
That gets rid of the warning in Chrome devtools, but still doesn't fix the scrolling issue on iOS.
See this link about passive listeners and preventDefault()
: addEventListener Parameters
passive:
ABoolean
which, iftrue
, indicates that the function specified by listener will never callpreventDefault()
. If a passive listener does callpreventDefault()
, the user agent will do nothing other than generate a console warning.
Chrome devtools is returning this error when dragging to change a value: http://nimb.ws/eb6jMn
It might be something with Chrome > 56 as mentioned here: https://github.com/bevacqua/dragula/issues/468
Upvoted solution: https://github.com/bevacqua/dragula/issues/468#issuecomment-284085998 "
touch-action: none
to the drag handle".