Home / Function/ pointercancel() — react Function Reference

pointercancel() — react Function Reference

Architecture documentation for the pointercancel() function in domEventSequences.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  1ce81e05_e892_8647_aba7_5d63c17ca494["pointercancel()"]
  d4066e75_dcea_2912_73ff_88e30b9530d2["domEventSequences.js"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|defined in| d4066e75_dcea_2912_73ff_88e30b9530d2
  7974d444_a5ab_942c_d619_86fa0d14daa3["pointercancel()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| 7974d444_a5ab_942c_d619_86fa0d14daa3
  1819405c_be2c_2496_d31b_ddd53ba73ba9["getPointerType()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| 1819405c_be2c_2496_d31b_ddd53ba73ba9
  010da236_784b_cbe9_c79d_2a93e35a2880["hasPointerEvent()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| 010da236_784b_cbe9_c79d_2a93e35a2880
  fcfc8602_c217_b7de_07c3_73df179fd512["dragstart()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| fcfc8602_c217_b7de_07c3_73df179fd512
  e34ccbc5_59a5_f36e_988d_f8b3d9276499["createTouch()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| e34ccbc5_59a5_f36e_988d_f8b3d9276499
  50f207cf_f1ef_284f_520d_b159fc0f8b6b["removeTouch()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| 50f207cf_f1ef_284f_520d_b159fc0f8b6b
  0dab3578_90b3_815b_5690_5f9eec1a66ca["createTouchEventPayload()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| 0dab3578_90b3_815b_5690_5f9eec1a66ca
  1b8517ac_305d_5291_45fd_a2194b5c7b2a["touchcancel()"]
  1ce81e05_e892_8647_aba7_5d63c17ca494 -->|calls| 1b8517ac_305d_5291_45fd_a2194b5c7b2a
  style 1ce81e05_e892_8647_aba7_5d63c17ca494 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/dom-event-testing-library/domEventSequences.js lines 175–197

export function pointercancel(target, defaultPayload) {
  const dispatchEvent = arg => target.dispatchEvent(arg);
  const pointerType = getPointerType(defaultPayload);

  const payload = {
    pointerId: defaultPointerId,
    pointerType,
    ...defaultPayload,
  };

  if (hasPointerEvent()) {
    dispatchEvent(domEvents.pointercancel(payload));
  } else {
    if (pointerType === 'mouse') {
      dispatchEvent(domEvents.dragstart(payload));
    } else {
      const touch = createTouch(target, payload);
      touchStore.removeTouch(touch);
      const touchEventPayload = createTouchEventPayload(target, touch, payload);
      dispatchEvent(domEvents.touchcancel(touchEventPayload));
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does pointercancel() do?
pointercancel() is a function in the react codebase, defined in packages/dom-event-testing-library/domEventSequences.js.
Where is pointercancel() defined?
pointercancel() is defined in packages/dom-event-testing-library/domEventSequences.js at line 175.
What does pointercancel() call?
pointercancel() calls 8 function(s): createTouch, createTouchEventPayload, dragstart, getPointerType, hasPointerEvent, pointercancel, removeTouch, touchcancel.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free