angular-off-click icon indicating copy to clipboard operation
angular-off-click copied to clipboard

Feature suggestion: handle drag event

Open appeltonen opened this issue 10 years ago • 1 comments

Off-click fires when touch device user ends target element drag. I suggest you add a touchmove event handler document.addEventListener("touchmove", touchMoveHandler, true); and variable var touchDrag = false;

Then add

function touchMoveHandler(event) {
  touchDrag = true;
}

And at the beginning of offClickEventHandler

if( touchDrag ) {
  touchDrag = false;
  return;
}

This would prevent off-click from firing when user was dragging target element.

appeltonen avatar Apr 08 '15 10:04 appeltonen

That makes sense. Since this is "off-click" and we could go as far as touch == click. But dragging != click and should not trigger off-click.

TheSharpieOne avatar Apr 10 '15 14:04 TheSharpieOne