MCPcopy
hub / github.com/facebook/react / pointermove

Function pointermove

packages/dom-event-testing-library/domEventSequences.js:287–314  ·  view source on GitHub ↗
(target, defaultPayload)

Source from the content-addressed store, hash-verified

285}
286
287export function pointermove(target, defaultPayload) {
288 const dispatch = arg => target.dispatchEvent(arg);
289 const pointerType = getPointerType(defaultPayload);
290
291 const payload = {
292 pointerId: defaultPointerId,
293 pointerType,
294 ...defaultPayload,
295 };
296
297 if (hasPointerEvent()) {
298 dispatch(
299 domEvents.pointermove({
300 pressure: pointerType === 'touch' ? 1 : 0.5,
301 ...payload,
302 }),
303 );
304 } else {
305 if (pointerType === 'mouse') {
306 dispatch(domEvents.mousemove(payload));
307 } else {
308 const touch = createTouch(target, payload);
309 touchStore.updateTouch(touch);
310 const touchEventPayload = createTouchEventPayload(target, touch, payload);
311 dispatch(domEvents.touchmove(touchEventPayload));
312 }
313 }
314}
315
316export function pointerup(target, defaultPayload) {
317 const dispatch = arg => target.dispatchEvent(arg);

Callers

nothing calls this directly

Calls 5

hasPointerEventFunction · 0.90
getPointerTypeFunction · 0.85
createTouchFunction · 0.85
createTouchEventPayloadFunction · 0.85
dispatchFunction · 0.70

Tested by

no test coverage detected