Skip to content

fix(grid): Recalculate horizontal size cache when scrolling horizontally with autosized columns#17425

Open
mddragnev wants to merge 5 commits into
masterfrom
mdragnev/fix-17392
Open

fix(grid): Recalculate horizontal size cache when scrolling horizontally with autosized columns#17425
mddragnev wants to merge 5 commits into
masterfrom
mdragnev/fix-17392

Conversation

@mddragnev

@mddragnev mddragnev commented Jul 16, 2026

Copy link
Copy Markdown
Member

Closes #17392

Description

Motivation / Context

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version:
  • Browser(s):
  • OS:

Screenshots / Recordings

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

@mddragnev
mddragnev marked this pull request as ready for review July 16, 2026 12:32
Copilot AI review requested due to automatic review settings July 16, 2026 12:32
@mddragnev
mddragnev requested a review from MayaKirova July 16, 2026 12:32

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 aims to fix an IgxGrid horizontal virtualization issue where grids with many width="auto" columns can end up with incorrect horizontal size caching, resulting in a visible gap at the end of horizontal scrolling (issue #17392).

Changes:

  • Triggers a manual “re-diff” attempt for the horizontal virtualization directives after auto-sizing columns in view.
  • Adds a unit test intended to validate that horizontal size caching remains correct when navigating horizontally with many auto-sized columns.

Reviewed changes

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

File Description
projects/igniteui-angular/grids/grid/src/grid-base.directive.ts Adds calls intended to rebuild horizontal virtualization caches after autoSizeColumnsInView() updates column pixel widths.
projects/igniteui-angular/grids/grid/src/column.spec.ts Adds a new test covering horizontal navigation with many width: 'auto' columns and imports scroll-detection helpers.

Comment thread projects/igniteui-angular/grids/grid/src/grid-base.directive.ts
Comment thread projects/igniteui-angular/grids/grid/src/column.spec.ts Outdated
Comment thread projects/igniteui-angular/grids/grid/src/column.spec.ts
@viktorkombov viktorkombov added 💥 status: in-test PRs currently being tested and removed ❌ status: awaiting-test PRs awaiting manual verification labels Jul 17, 2026
@viktorkombov

Copy link
Copy Markdown
Contributor

The sizing now works correctly in a zone-based environment.

In zoneless mode, however, the related issue is still reproducible. In the gridFinJs sample, navigating horizontally with Ctrl + Arrow leaves a large white space at the end of the grid that does not recover. The column widths also become disproportionate to their corresponding headers.

zonebased1

I we apply the changes from the PR #17328 that replaces NgZone.onStable with afterNextRender the persistent white space is removed. A visible flicker still remains, which I think is not present in the zone-based environment.

zonebased

A similar issue is reproducible with vertical virtualization. Navigating from the first row to the last one using Ctrl + Arrow Down leaves a gap in the vertical scroll area. I have logged it - #17432.

image

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.

[Grid] Grid with a lot of auto sized columns leave a large gap at the end of horizontal scroll

3 participants