Skip to content

Fix IgxGridSelectionService.generateRange crash on drag-select released outside grid#17349

Open
mvanhorn wants to merge 1 commit into
IgniteUI:masterfrom
mvanhorn:fix/17335-generaterange-null-crash
Open

Fix IgxGridSelectionService.generateRange crash on drag-select released outside grid#17349
mvanhorn wants to merge 1 commit into
IgniteUI:masterfrom
mvanhorn:fix/17335-generaterange-null-crash

Conversation

@mvanhorn

Copy link
Copy Markdown

Closes #17335

Description

generateRange no longer throws when the selection anchor is null; it returns an empty range for that case instead of dereferencing the missing anchor.

Motivation / Context

When the range generator was called before a selection anchor was set (a null anchor), it dereferenced the anchor and threw, surfacing as a runtime crash in the consuming grid/selection logic. Guarding the null anchor returns a sensible empty range and avoids the crash. Closes #17335.

Type of Change (check all that apply):

  • Bug fix

Component(s) / Area(s) Affected:

Selection / range generation utility.

How Has This Been Tested?

  • Unit tests

Test Configuration:

  • Angular version: repository default
  • Browser(s): N/A (unit tests)
  • OS: macOS

Screenshots / Recordings

N/A — non-visual bug fix.

Checklist:

  • Added focused regression tests for the null-anchor case.

AI was used for assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IgxGridSelectionService.generateRange crashes on drag-select released outside grid

1 participant