MCPcopy
hub / github.com/adobe/react-spectrum / onTouchEnd

Function onTouchEnd

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

Source from the content-addressed store, hash-verified

158 }
159 };
160 let onTouchEnd = (e: TouchEvent) => {
161 let touch = [...e.changedTouches].findIndex(
162 ({identifier}) => identifier === state.current.id
163 );
164 if (touch >= 0) {
165 // eslint-disable-next-line react-hooks/rules-of-hooks
166 endEvent(e, 'touch');
167 state.current.id = null;
168 let ownerWindow = getOwnerWindow(getEventTarget(e) as Element);
169 removeGlobalListener(ownerWindow, 'touchmove', onTouchMove);
170 removeGlobalListener(ownerWindow, 'touchend', onTouchEnd);
171 removeGlobalListener(ownerWindow, 'touchcancel', onTouchEnd);
172 }
173 };
174 moveProps.onTouchStart = (e: React.TouchEvent) => {
175 if (e.changedTouches.length === 0 || state.current.id != null) {
176 return;

Callers

nothing calls this directly

Calls 2

getOwnerWindowFunction · 0.90
getEventTargetFunction · 0.90

Tested by

no test coverage detected