Skip to content

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

Open
mddragnev wants to merge 3 commits into
masterfrom
mdragnev/fix-plus-keydown
Open

mddragnev wants to merge 3 commits into
masterfrom
mdragnev/fix-plus-keydown

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

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

The production fix is absent, leaving both new regression tests failing.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds grid regression tests for issues #17577 and #17605.

Changes:

  • Tests + and = on focused cells.
  • Tests these keys inside cell editors.
  • The described production guard is missing, so both tests fail.
File Description
grid-keyBoardNav.spec.ts Adds focused-cell keyboard regression coverage.
grid-cell-editing.spec.ts Adds cell-editor keyboard regression coverage.

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

Comment thread projects/igniteui-angular/grids/grid/src/grid-cell-editing.spec.ts
Comment thread projects/igniteui-angular/grids/grid/src/grid-keyBoardNav.spec.ts
@mddragnev
mddragnev requested a balanced review from Copilot October 6, 2026 10:20
@mddragnev
mddragnev requested a review from igdmdimitrov October 6, 2026 10:21
@mddragnev mddragnev changed the title test(nav): Add tests for the two issues fix(grid): Guard dispatchEvent against an undefined position from getNextPosition Oct 6, 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.

Copilot review overview

🟡 Changes recommended

Repeated + and = keydowns are still prevented, blocking held-key input and repeated browser zoom.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)

Comment thread projects/igniteui-angular/grids/core/src/grid-navigation.service.ts
@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 7, 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: 23.0.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

4 participants