diff --git a/src/dd-draggable.ts b/src/dd-draggable.ts index d15fcf3c0..8ec6a20cd 100644 --- a/src/dd-draggable.ts +++ b/src/dd-draggable.ts @@ -158,7 +158,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt e.preventDefault(); // preventDefault() prevents blur event which occurs just after mousedown event. // if an editable content has focus, then blur must be call - if(document.activeElement) (document.activeElement as HTMLElement).blur(); + if (document.activeElement) (document.activeElement as HTMLElement).blur(); DDManager.mouseHandled = true; return true; diff --git a/src/dd-touch.ts b/src/dd-touch.ts index 3cbcebc80..a81f30186 100644 --- a/src/dd-touch.ts +++ b/src/dd-touch.ts @@ -118,7 +118,8 @@ function simulatePointerMouseEvent(e: PointerEvent, simulatedType: string) { */ export function touchstart(e: TouchEvent): void { // Ignore the event if another widget is already being handled - if (DDTouch.touchHandled) return; DDTouch.touchHandled = true; + if (DDTouch.touchHandled) return; + DDTouch.touchHandled = true; // Simulate the mouse events // simulateMouseEvent(e, 'mouseover'); @@ -132,7 +133,7 @@ export function touchstart(e: TouchEvent): void { */ export function touchmove(e: TouchEvent): void { // Ignore event if not handled by us - if (!DDTouch.touchHandled) return; + if (!DDTouch.touchHandled) return; simulateMouseEvent(e, 'mousemove'); } @@ -173,6 +174,7 @@ export function touchend(e: TouchEvent): void { * so instead of PointerEvent to still get enter/leave and send the matching mouse event. */ export function pointerdown(e: PointerEvent): void { + // console.log("pointer down") (e.target as HTMLElement).releasePointerCapture(e.pointerId) // <- Important! }