Skip to content

fix(list): keep touch panning off the Angular zone and idle items inert - #17471

Open
ChronosSF with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-virtualization-lag-in-igxlist
Open

fix(list): keep touch panning off the Angular zone and idle items inert#17471
ChronosSF with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-virtualization-lag-in-igxlist

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

After HammerJS was replaced with native pointer/touch handling, continuous finger dragging over an igxFor-virtualized igx-list stutters and lags behind the gesture.

Root cause

  1. IgxListItemComponent attaches its IgxTouchManager listeners inside the Angular zone, so every pointermove of a drag schedules a full ApplicationRef.tick(). The previous HammerGesturesManager bound listeners via NgZone.runOutsideAngular(). With eager change detection and impure pipes over 100k records, this dominates the frame budget.
  2. Items track gestures even when panning is disabled (allowLeftPanning/allowRightPanning both default to false). Tracking takes a pointer capture on the item and calls preventDefault() on every touchmove, so idle items actively interfere with the scroll-inertia touch scrolling.

Changes

  • IgxTouchManagerOptions (core/src/core/touch.ts) — two new optional, @internal options:
    • ngZone — listeners are attached with runOutsideAngular(); only the discrete callbacks (pointerDown, panStart, panEnd, panCancel, tap, swipe) re-enter via ngZone.run(). The high-frequency panMove deliberately stays outside.
    • canStart — predicate evaluated on pointerdown; returning false skips the gesture entirely (no pointer capture, no touchmove preventDefault).
    • Consumers that pass neither (carousel, navigation drawer, time picker) are unaffected — both paths fall back to a direct call.
  • IgxListItemComponent — opts into both. panMove only writes DOM (transform, visibility), so it needs no change detection; the emitting callbacks still run in the zone.
  • Tests — idle items must not capture the pointer or prevent touchmove defaults; panMove must run outside the zone while panStart/panEnd run inside.
  • CHANGELOG — noted under 22.1.0.
// list-item.component.ts
this._gestures = new IgxTouchManager(this.elementRef.nativeElement, {
    panStart: () => this.panStart(),
    panMove: (event) => this.panMove(event),
    panEnd: () => this.panEnd(),
    panCancel: () => this.panCancel()
}, {
    ngZone: this._zone,
    // Do not track the gesture at all when the item cannot be panned. Otherwise every
    // pressed item captures the pointer and suppresses the touch scrolling of the list.
    canStart: () => this.panningAllowed
});

canStart is evaluated lazily per gesture, so runtime changes to the list's panning inputs are picked up without recreating the manager; headers never track.

Copilot AI review requested due to automatic review settings July 30, 2026 07:57

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.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI review requested due to automatic review settings July 30, 2026 08:10

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.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI changed the title [WIP] Fix lag during continuous touch scrolling in igxFor fix(list): keep touch panning off the Angular zone and idle items inert Jul 30, 2026
Copilot AI requested a review from ChronosSF July 30, 2026 08:11
@ChronosSF ChronosSF added the 💥 status: in-test PRs currently being tested label Jul 30, 2026
Copilot AI review requested due to automatic review settings July 30, 2026 14:39

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 31, 2026 12:27

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@ChronosSF
ChronosSF marked this pull request as ready for review July 31, 2026 13:16
@ChronosSF ChronosSF added ✅ status: verified Applies to PRs that have passed manual verification version: 22.1.x and removed 💥 status: in-test PRs currently being tested labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version: 22.1.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IgxList with IgxFor virtualization lags during continuous touch scrolling

3 participants