Skip to content

fix(grid): preserve row order after viewport resize - #17783

Open
teodosiah wants to merge 10 commits into
masterfrom
thristodorova/fix-17575
Open

teodosiah wants to merge 10 commits into
masterfrom
thristodorova/fix-17575

Conversation

@teodosiah

Copy link
Copy Markdown
Contributor

Closes #17575

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

@teodosiah teodosiah added ❌ status: awaiting-test PRs awaiting manual verification grid labels Oct 16, 2026

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.

🟡 Changes recommended

Prepending during horizontal viewport growth can leave display offsets stale in both directives.

1 open issue
What changed in this PR

Addresses #17575 by preserving virtualized row order when a scrolled grid’s viewport grows.

Changes:

  • Prepends preceding items when expanding a chunk at the data boundary.
  • Adds grid and directive regression tests for viewport shrink/grow cycles.
File Description
projects/​igniteui-angular/​grids/​grid/​src/​grid.component.spec.ts Tests grid row ordering after resizing.
projects/​igniteui-angular/​directives/​src/​directives/​for-of/​for_of.directive.ts Updates both directives to prepend boundary items.
projects/​igniteui-angular/​directives/​src/​directives/​for-of/​for_of.directive.spec.ts Tests virtualized item ordering after resizing.

Review effort: Balanced

Comment on lines +1511 to +1512
elemIndex = --this.state.startIndex!;
prepend = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@teodosiah ,enabled auto-merge but it won't happen until this comment is resolved one way or another. If you think it's wrong, you can resolve it with an explanation.

@igdmdimitrov igdmdimitrov added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Oct 21, 2026

@mddragnev mddragnev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might need a changelog entry for a bug fix.

teodosiah and others added 2 commits October 28, 2026 12:06
- Sync the offset after a container resize through _updateScrollOffset,
  after the scrollbar size is recalculated, and make it RTL aware.
- Extract the shared addLastElem logic into insertChunkElem with a
  createTemplateContext override for the grid directive.
- Add LTR/RTL tests for the offset after igxForOf changes.
- Add a changelog entry for #17575.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teodosiah
teodosiah requested a review from mddragnev October 28, 2026 10:49
teodosiah and others added 2 commits October 29, 2026 10:17
- Use the isRTL getter in _updateScrollOffset instead of the scroll sign.
- Drop @hidden from the protected insertChunkElem.
- Grow the viewport without clamping the scroll position in the vertical
  test and assert the rows order and offset without re-scrolling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teodosiah
teodosiah requested a review from mddragnev October 29, 2026 08:36
@igdmdimitrov igdmdimitrov added 💥 status: in-test PRs currently being tested ✅ status: verified Applies to PRs that have passed manual verification and removed ✅ status: verified Applies to PRs that have passed manual verification 💥 status: in-test PRs currently being tested labels Oct 29, 2026
@ChronosSF
ChronosSF enabled auto-merge (squash) October 30, 2026 17:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

igx-grid leaves blank space at the bottom after a flex-sized container grows back while scrolled to the bottom

6 participants