-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
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
- Open the example
- Move the mouse quickly across the rows
- Observe the reduced rendering smoothness during hover
- 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