MCPcopy Create free account
hub / github.com/adobe/react-spectrum / onTouchEnd

Function onTouchEnd

packages/react-aria/src/interactions/useMove.ts:158–170  ·  view source on GitHub ↗
(e: TouchEvent)

Source from the content-addressed store, hash-verified

156 }
157 };
158 let onTouchEnd = (e: TouchEvent) => {
159 let touch = [...e.changedTouches].findIndex(
160 ({identifier}) => identifier === state.current.id
161 );
162 if (touch >= 0) {
163 endEvent(e, 'touch');
164 state.current.id = null;
165 let ownerWindow = getOwnerWindow(getEventTarget(e));
166 removeGlobalListener(ownerWindow, 'touchmove', onTouchMove);
167 removeGlobalListener(ownerWindow, 'touchend', onTouchEnd);
168 removeGlobalListener(ownerWindow, 'touchcancel', onTouchEnd);
169 }
170 };
171 moveProps.onTouchStart = (e: React.TouchEvent) => {
172 if (e.changedTouches.length === 0 || state.current.id != null) {
173 return;

Callers

nothing calls this directly

Calls 2

getOwnerWindowFunction · 0.90
getEventTargetFunction · 0.90

Tested by

no test coverage detected