Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dd-draggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions src/dd-touch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
}
Expand Down Expand Up @@ -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!
}

Expand Down