(e: TouchEvent)
| 103 | * @param {Object} e The document's touchend event |
| 104 | */ |
| 105 | export function touchend(e: TouchEvent): void { |
| 106 | |
| 107 | // Ignore event if not handled |
| 108 | if (!DDTouch.touchHandled) return; |
| 109 | |
| 110 | // cancel delayed leave event when we release on ourself which happens BEFORE we get this! |
| 111 | if (DDTouch.pointerLeaveTimeout) { |
| 112 | window.clearTimeout(DDTouch.pointerLeaveTimeout); |
| 113 | delete DDTouch.pointerLeaveTimeout; |
| 114 | } |
| 115 | |
| 116 | const wasDragging = !!DDManager.dragElement; |
| 117 | |
| 118 | // Simulate the mouseup event |
| 119 | simulateMouseEvent(e, 'mouseup'); |
| 120 | // simulateMouseEvent(event, 'mouseout'); |
| 121 | |
| 122 | // If the touch interaction did not move, it should trigger a click |
| 123 | if (!wasDragging) { |
| 124 | simulateMouseEvent(e, 'click'); |
| 125 | } |
| 126 | |
| 127 | // Unset the flag to allow other widgets to inherit the touch event |
| 128 | DDTouch.touchHandled = false; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Note we don't get touchenter/touchleave (which are deprecated) |
no test coverage detected