Skip to content

fix(hierarchical-grid): align selected data with expanded row indexes - 21.2.x#17300

Open
georgianastasov wants to merge 4 commits into
21.2.xfrom
ganastasov/fix-17295-21.2.x
Open

fix(hierarchical-grid): align selected data with expanded row indexes - 21.2.x#17300
georgianastasov wants to merge 4 commits into
21.2.xfrom
ganastasov/fix-17295-21.2.x

Conversation

@georgianastasov
Copy link
Copy Markdown
Contributor

Closes #17295

Description

This PR fixes a Hierarchical Grid issue where copying/selecting a cell from an expanded parent row returned the value from the previous row.

The fix uses dataView as the selected data source and keeps child-grid placeholder rows as null to preserve index alignment with visible rows.

Motivation / Context

After expanding the Artist Ahmad Nazeri row, copying its Artist cell returned Artist Babila Ebwélé instead of the selected row value.

This happened because selection indexes were based on visible rows, while the selected data source did not account for expanded child-grid placeholder rows.

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:

Hierarchical Grid, cell selection/copy

How Has This Been Tested?

Added a regression test that expands the Artist Ahmad Nazeri row, selects its Artist cell, and verifies getSelectedData() returns the correct value instead of the previous row value.|

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version: 21.2.x
  • Browser(s): All
  • OS: All

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes Hierarchical Grid selected-data alignment when expanded child-grid placeholder rows are present, so copying/selecting cells from expanded parent rows resolves the intended row data.

Changes:

  • Adds a Hierarchical Grid getSelectedData override that builds a dataView-aligned selection source and uses null for child-grid placeholder rows.
  • Guards the base hierarchical index-adjustment path so it only applies when using filteredSortedData.
  • Adds a regression test for selecting/copying an expanded parent row cell.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
projects/igniteui-angular/grids/hierarchical-grid/src/hierarchical-grid.integration.spec.ts Adds regression coverage for selected data after expanding a hierarchical row.
projects/igniteui-angular/grids/hierarchical-grid/src/hierarchical-grid.component.ts Introduces Hierarchical Grid-specific selected-data source alignment.
projects/igniteui-angular/grids/grid/src/grid-base.directive.ts Narrows hierarchical selection index adjustment to the legacy filtered/sorted source path.

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.

HierarchicalGrid copies value from previous row after row is expanded

2 participants