Home / Function/ _handleWheelShift() — react Function Reference

_handleWheelShift() — react Function Reference

Architecture documentation for the _handleWheelShift() function in VerticalScrollView.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c53bd458_8fdb_18ff_350b_512cb76d863c["_handleWheelShift()"]
  15e8ee71_cd71_e6f6_40e5_59e8feb4985d["VerticalScrollView"]
  c53bd458_8fdb_18ff_350b_512cb76d863c -->|defined in| 15e8ee71_cd71_e6f6_40e5_59e8feb4985d
  eb1765a3_0863_dd2c_a927_6e4f28217907["handleInteraction()"]
  eb1765a3_0863_dd2c_a927_6e4f28217907 -->|calls| c53bd458_8fdb_18ff_350b_512cb76d863c
  dd08a669_02e3_2f36_98cb_b33b321d1071["scrollBy()"]
  c53bd458_8fdb_18ff_350b_512cb76d863c -->|calls| dd08a669_02e3_2f36_98cb_b33b321d1071
  5cadbad4_62d2_f23e_1bf4_225db867ed8b["rectContainsPoint()"]
  c53bd458_8fdb_18ff_350b_512cb76d863c -->|calls| 5cadbad4_62d2_f23e_1bf4_225db867ed8b
  style c53bd458_8fdb_18ff_350b_512cb76d863c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/view-base/VerticalScrollView.js lines 225–246

  _handleWheelShift(interaction: WheelWithShiftInteraction): boolean {
    const {
      location,
      delta: {deltaX, deltaY},
    } = interaction.payload;

    if (!rectContainsPoint(location, this.frame)) {
      return false; // Not scrolling on view
    }

    const absDeltaX = Math.abs(deltaX);
    const absDeltaY = Math.abs(deltaY);
    if (absDeltaX > absDeltaY) {
      return false; // Scrolling horizontally
    }

    if (absDeltaY < MOVE_WHEEL_DELTA_THRESHOLD) {
      return false; // Movement was too small and should be ignored.
    }

    return this.scrollBy(deltaY);
  }

Domain

Subdomains

Frequently Asked Questions

What does _handleWheelShift() do?
_handleWheelShift() is a function in the react codebase, defined in packages/react-devtools-timeline/src/view-base/VerticalScrollView.js.
Where is _handleWheelShift() defined?
_handleWheelShift() is defined in packages/react-devtools-timeline/src/view-base/VerticalScrollView.js at line 225.
What does _handleWheelShift() call?
_handleWheelShift() calls 2 function(s): rectContainsPoint, scrollBy.
What calls _handleWheelShift()?
_handleWheelShift() is called by 1 function(s): handleInteraction.

Analyze Your Own Codebase

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

Try Supermodel Free