Skip to content

fix(touch): allow pointerDown veto to stop tracking and free scroll - #17467

Open
ChronosSF wants to merge 1 commit into
masterfrom
sstoychev/prevent-touch-block
Open

fix(touch): allow pointerDown veto to stop tracking and free scroll#17467
ChronosSF wants to merge 1 commit into
masterfrom
sstoychev/prevent-touch-block

Conversation

@ChronosSF

Copy link
Copy Markdown
Member

IgxTouchManager starts tracking on every accepted pointerdown and, via its non-passive touchmove listener, calls preventDefault() while tracking. When attached to document (e.g. Navigation Drawer), this cancels normal page scrolling even when the consumer would ignore the gesture. Addresses the review comments in pullrequestreview-4787557464.

Changes

  • core/src/core/touch.ts

    • pointerDown callback signature is now (event: IgxGestureEvent) => boolean | void.
    • When pointerDown returns false, the manager stops tracking immediately via a new _stopTracking() helper — resets _tracking/_panStarted/_pointerId/_startTarget and best-effort releases pointer capture — so touchmove no longer suppresses scrolling for vetoed gestures.
  • navigation-drawer/.../navigation-drawer.component.ts

    • panStart (wired as the drawer's pointerDown) now returns boolean: true when a pan is accepted (drawer open, or touch starts within maxEdgeZone), false otherwise (gestures disabled, pinned, non-touch, or touch outside the edge zone), letting the manager bail out and leave scrolling intact.
// touch.ts
if (this.callbacks.pointerDown?.(this._createEvent(event)) === false) {
    this._stopTracking(event.pointerId);
}

Returning nothing preserves the previous behavior, so other consumers are unaffected.

Copilot AI review requested due to automatic review settings July 28, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the shared IgxTouchManager gesture tracking so consumers can veto a pointerdown and immediately stop tracking, preventing the manager’s non-passive touchmove listener from suppressing normal page scrolling (notably when gestures are attached on document, such as in Navigation Drawer).

Changes:

  • Expanded IgxTouchManagerCallbacks.pointerDown to allow returning false and added _stopTracking() to immediately reset tracking state and best-effort release pointer capture.
  • Updated Navigation Drawer’s panStart (used as pointerDown) to return true/false based on whether the gesture should be handled (edge-zone / open drawer) or ignored (allowing scroll).
  • Includes package-lock.json changes that appear unrelated to the touch fix.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
projects/igniteui-angular/core/src/core/touch.ts Adds a veto-able pointerDown callback contract and immediate tracking teardown to avoid blocking scroll for ignored gestures.
projects/igniteui-angular/navigation-drawer/src/navigation-drawer/navigation-drawer.component.ts Makes panStart return a boolean to accept/veto gestures, enabling scroll-friendly behavior when touches start outside the edge zone.
package-lock.json Contains lockfile diffs unrelated to the stated change; likely accidental/high-churn.

Comment on lines +220 to +225
// Let the consumer veto the gesture (e.g. the touch did not start in an active
// zone). Returning `false` stops tracking immediately so the `touchmove` listener
// does not block normal scrolling and other gestures are not interfered with.
if (this.callbacks.pointerDown?.(this._createEvent(event)) === false) {
this._stopTracking(event.pointerId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants