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

Function onPointerMove

packages/react-aria/src/interactions/useMove.ts:188–203  ·  view source on GitHub ↗
(e: PointerEvent)

Source from the content-addressed store, hash-verified

186 };
187 } else {
188 let onPointerMove = (e: PointerEvent) => {
189 if (e.pointerId === state.current.id) {
190 let pointerType = (e.pointerType || 'mouse') as PointerType;
191
192 // Problems with PointerEvent#movementX/movementY:
193 // 1. it is always 0 on macOS Safari.
194 // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS
195 moveEvent(
196 e,
197 pointerType,
198 e.pageX - (state.current.lastPosition?.pageX ?? 0),
199 e.pageY - (state.current.lastPosition?.pageY ?? 0)
200 );
201 state.current.lastPosition = {pageX: e.pageX, pageY: e.pageY};
202 }
203 };
204
205 let onPointerUp = (e: PointerEvent) => {
206 if (e.pointerId === state.current.id) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected