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

Function onTouchMove

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

Source from the content-addressed store, hash-verified

141 };
142
143 let onTouchMove = (e: TouchEvent) => {
144 let touch = [...e.changedTouches].findIndex(
145 ({identifier}) => identifier === state.current.id
146 );
147 if (touch >= 0) {
148 let {pageX, pageY} = e.changedTouches[touch];
149 moveEvent(
150 e,
151 'touch',
152 pageX - (state.current.lastPosition?.pageX ?? 0),
153 pageY - (state.current.lastPosition?.pageY ?? 0)
154 );
155 state.current.lastPosition = {pageX, pageY};
156 }
157 };
158 let onTouchEnd = (e: TouchEvent) => {
159 let touch = [...e.changedTouches].findIndex(
160 ({identifier}) => identifier === state.current.id

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected