Skip to content

bug(aria/grid): pointermove causes grid change detection although selection or dragging is disabled #32700

@jonashammerschmidt

Description

@jonashammerschmidt

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

ngGrid from @angular/aria registers an unconditional (pointermove) host listener on the grid element.

Although onPointermove contains an early return when selection, range selection, or dragging are not active, this does not prevent the event from entering Angular’s event pipeline.

As a result, Angular still runs change detection for the grid subtree on every mouse movement over the table, even when:

  • no selection is enabled
  • no range selection is enabled
  • no dragging is happening
  • no application state changes at all

During these change detection cycles, the host bindings of every ngGridCell are re-evaluated (tabindex, aria-*, data-active, etc.).

On larger grids, this leads to a noticeable performance issue during simple mouse interaction which dont change application state.

Reproduction

StackBlitz link:
https://stackblitz.com/edit/stackblitz-starters-project-21version-la4fpkwe

Steps to reproduce

  1. Open the example
  2. Move the mouse quickly across the rows
  3. Observe the reduced rendering smoothness during hover
  4. Remove the ngGrid attribute from the and compare

    Expected Behavior

    Mouse movement over the grid should not trigger Angular change detection when no selection or range selection is active.

    Simple hover interaction over rows should remain smooth and not cause large scale HostBinding recalculations.

    Actual Behavior

    Every pointer movement over the grid triggers Angular change detection.

    This leads to repeated HostBinding recalculations for all ngGridCell instances, which becomes visible as laggy or less smooth hover interaction on larger grids.

    Environment

    Angular CLI : 21.1.1
    Angular : 21.1.1
    Node.js : 20.19.1
    Package Manager : npm 10.8.2
    Operating System : linux x64

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentaria/grid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions