fix(body): preserve original cell index - #804
Open
spike-rabbit wants to merge 1 commit into
Open
Conversation
9 tasks
There was a problem hiding this comment.
Pull request overview
This PR aims to fix ActivateEvent.cellIndex for cell activation so it reflects the index in the original columns input array (instead of resetting within each pinned render group). This is relevant to consumers who use cellIndex to map back to their column definitions when columns are pinned.
Changes:
- Update body row cell-activation handling to compute
cellIndexfrom the fullcolumns()list rather than the per-pin-group loop index. - Extend keyboard navigation tests to capture
activateevents and assertcellIndexbehavior for a pinned column.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/ngx-datatable/src/lib/components/body/body-row.component.ts | Changes how cellIndex is computed during cell activation by passing the column instead of $index. |
| projects/ngx-datatable/src/lib/components/body/keyboard-navigation.spec.ts | Adds an activate listener and a regression test asserting cellIndex for a pinned column. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
spike-rabbit
marked this pull request as draft
August 17, 2026 09:34
spike-rabbit
force-pushed
the
fix/body-row-cell-index
branch
from
August 20, 2026 06:48
3a911af to
7a6f69e
Compare
Columns may internally be reordered due to frozen left/right. This change now makes sure that keyboard navigation always maintains a proper index when navigating and selecting cells.
spike-rabbit
force-pushed
the
fix/body-row-cell-index
branch
from
August 20, 2026 06:51
7a6f69e to
27a9b6d
Compare
spike-rabbit
marked this pull request as ready for review
August 20, 2026 06:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Cell activation reports a
cellIndexrelative to its pinned render group, so the index resets for left, center, and right groups.What is the new behavior?
Cell activation now reports the index from the original columns array. A keyboard-navigation regression test covers a pinned column.
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
Tests:
npx ng test ngx-datatable-lib --watch=false --include='projects/ngx-datatable/src/lib/components/body/keyboard-navigation.spec.ts'