Skip to content

fix(pivot-grid): highlight the row header that Home and End scroll to - #17939

Merged
kdinev merged 9 commits into
masterfrom
vkombov/fix-17932
Nov 25, 2026
Merged

kdinev merged 9 commits into
masterfrom
vkombov/fix-17932

Conversation

@viktorkombov

Copy link
Copy Markdown
Contributor

Closes #17932

Description

In the horizontal row layout, a key press that scrolls to another row dimension header, such as Home or End, now highlights that header. Before, the header that was active before the key press stayed highlighted.

Motivation / Context

Regression from #17699 (22.2.1): scrollToNextHorizontalDimRow() calls detectChanges() after the scroll so that the new rows can be looked up, and that renders the row headers before setActiveNode() changes the active node. Nothing marked the grid for check after that, so the headers kept the old highlight. handleNavigation() now calls notifyChanges() after it sets the active node in the horizontal layout.

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:

Pivot Grid

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

A new zoneless spec in pivot-grid.spec.ts sets up a horizontal layout like the Pivot Grid Layout sample, presses End and Home with real key events and checks the highlighted row header (fails without the fix). The pivot-grid.spec.ts and pivot-grid-keyboard-nav.spec.ts specs pass. The pivot-noop dev demo with the sample's row configuration shows the bug without the fix and the right highlight with it.

Test Configuration:

  • Angular version: 22.2.3
  • Browser(s): Chromium (Vitest browser mode)
  • OS: Windows 11

Screenshots / Recordings

The issue shows the actual and the expected result.

Checklist:

  • All relevant labels 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

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 18:17

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.

🟢 Approval recommended

No active review issues were identified for the horizontal-layout row-header highlighting fix.

No open issues 🎉

What changed in this PR

Fixes Pivot Grid issue #17932 so horizontal-layout keyboard navigation highlights the destination row header rather than leaving the previous header highlighted.

Changes:

  • Notifies change detection after updating the active node in horizontal layouts.
  • Adds a zoneless regression test for highlighting after End and Home navigation.
  • Documents the fix in the changelog.
File Description
projects/​igniteui-angular/​grids/​pivot-grid/​src/​pivot-grid.spec.ts Adds regression coverage for End and Home row-header highlighting.
projects/​igniteui-angular/​grids/​pivot-grid/​src/​pivot-grid-navigation.service.ts Requests a rendering update after horizontal-layout navigation changes the active node.
CHANGELOG.md Records the corrected highlighting behavior and links issue #17932.

Review effort: Balanced

@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.

The root cause is right. However, I'd rather remove that call than add a notifyChanges() to undo its side effect.
It's there because, for jumps of more than 4 rows (MAX_PERF_SCROLL_DIFF), the row dimension igxGridFor only reassigns the row contexts and calls markForCheck(). The rows render on the next tick, but gridScroll fires before that tick, so the lookup saw stale rows. The grid emits verticalScrollContainer.chunkLoad after that render, which is what the base grid navigation already waits on (performVerticalScrollToCell). If we wait on chunkLoad, the rows are current without forcing a render. The notifyChanges() after setActiveNode() is still needed, because navigation now resumes after that render and activeNode is mutated in place.

@viktorkombov

Copy link
Copy Markdown
Contributor Author

Agreed, waiting on chunkLoad is cleaner: the rows are already rendered when it fires, so the detectChanges() is gone, and the notifyChanges() after setActiveNode() stays.
Two of the #17699 specs (should scroll to the row dimension cells outside of the view and should jump to the first and last row dimension cells outside of the view) await handleNavigation() before fixture.detectChanges(), so with chunkLoad they waited for a render that never came and timed out. They now call fixture.autoDetectChanges(), like the other grid navigation specs that scroll.
The jump spec still catches the stale rows (Cannot read properties of undefined (reading 'contentCells')) if the wait goes back to gridScroll without the render, and the new zoneless spec still fails without notifyChanges().
Pushed in c731b86.

mddragnev
mddragnev previously approved these changes Nov 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@igdmdimitrov igdmdimitrov added 💥 status: in-test PRs currently being tested ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification 💥 status: in-test PRs currently being tested labels Nov 19, 2026
@kdinev
kdinev enabled auto-merge (squash) November 25, 2026 15:11
@kdinev
kdinev merged commit 6b08737 into master Nov 25, 2026
7 checks passed
@kdinev
kdinev deleted the vkombov/fix-17932 branch November 25, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Pivot Grid] Home and End leave the previous row header highlighted in the horizontal layout

5 participants