MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / touchend

Function touchend

src/dd-touch.ts:105–129  ·  view source on GitHub ↗
(e: TouchEvent)

Source from the content-addressed store, hash-verified

103 * @param {Object} e The document's touchend event
104 */
105export 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)

Callers 1

dd-touch-spec.tsFile · 0.90

Calls 1

simulateMouseEventFunction · 0.85

Tested by

no test coverage detected