Skip to content

fix(grid): Guard dispatchEvent against an undefined position from getNextPosition - #17727

Open
mddragnev wants to merge 3 commits into
22.2.xfrom
mdragnev/fix-plus-keydown-22.2.x
Open

mddragnev wants to merge 3 commits into
22.2.xfrom
mdragnev/fix-plus-keydown-22.2.x

Conversation

@mddragnev

Copy link
Copy Markdown
Member

Closes #17577 #17605

Description

Typing + or = in a grid cell editor, or pressing them (or the Ctrl + + zoom shortcut) on a focused cell, threw TypeError: Cannot read properties of undefined (reading 'rowIndex'), and in the editor the character wasn't inserted. This fixes the regression by having dispatchEvent return early when getNextPosition gives no target position

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 requested a review from igdmdimitrov October 6, 2026 10:23
Copilot AI balanced review requested due to automatic review settings October 6, 2026 10:23

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.

Copilot review overview

🟡 Changes recommended

Shift-based + events can still mutate cell selection before the new guard returns.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Prevents grid navigation from dereferencing an undefined target when + or = is pressed.

Changes:

  • Adds an early return when no navigation position exists.
  • Adds focused-cell and cell-editor regression tests.
File Description
grid-navigation.service.ts Guards missing navigation positions.
grid-keyBoardNav.spec.ts Tests focused-cell key handling.
grid-cell-editing.spec.ts Tests editor key handling.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread projects/igniteui-angular/grids/core/src/grid-navigation.service.ts
@mddragnev mddragnev changed the title fix(grid): Guard dispatchEvent against an undefined position from getNextPosition- #17725 fix(grid): Guard dispatchEvent against an undefined position from getNextPosition Oct 6, 2026
@viktorkombov viktorkombov 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 Oct 6, 2026

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 keyboard-navigation version: 22.2.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants