Repository navigation
fix(grid): do not group by a column when its move is cancelled with Escape - #17781
Open
ivanvpetrov wants to merge 2 commits into
Open
ivanvpetrov wants to merge 2 commits into
ivanvpetrov wants to merge 2 commits into
Conversation
ivanvpetrov
changed the base branch from
master
to
ipetrov/drag-cancel-upon-escape
October 16, 2026 08:02
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Cancellation before movement exceeds the drag tolerance leaves the interaction active, allowing the same gesture to drag and drop later.
1 open finding
What changed in this PR
Updates grid column moving to use the drag-cancellation API, preventing cancelled moves from grouping columns or blocking later drops.
Changes:
- Replaces simulated drops with explicit cancellation.
- Removes the obsolete cancellation flag.
- Adds grid and tree-grid regression tests and a changelog entry.
| File | Description |
|---|---|
| projects/igniteui-angular/grids/tree-grid/src/tree-grid-grouping.spec.ts | Tests Escape cancellation over tree-grid grouping. |
| projects/igniteui-angular/grids/grid/src/grid.groupby.spec.ts | Tests cancelled grouping and hover cleanup. |
| projects/igniteui-angular/grids/grid/src/column-moving.spec.ts | Tests reordering after cancellation. |
| projects/igniteui-angular/grids/core/src/moving/moving.service.ts | Removes the cancellation flag. |
| projects/igniteui-angular/grids/core/src/moving/moving.drop.directive.ts | Removes flag-based drop suppression. |
| projects/igniteui-angular/grids/core/src/moving/moving.drag.directive.ts | Uses the drag-cancellation API. |
| CHANGELOG.md | Documents the cancellation fixes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
ivanvpetrov
marked this pull request as ready for review
October 16, 2026 09:06
Cancel the column move with cancelDrag() on Escape or a cancelled columnMoving event instead of dispatching a drop guarded by a flag. The group-by area no longer groups by the cancelled column, and a cancelled move no longer blocks the next header drop.
Cancelling a column move before the pointer passes the drag tolerance left the move pending, so the same gesture could still drag and drop the column. End the pending interaction as a release does, and cancel an active drag without dropping.
kdinev
force-pushed
the
ipetrov/fix-17745-grid-group-drag
branch
from
October 19, 2026 07:59
42d5c51 to
5e66204
Compare
This branch has not been deployed
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.

Closes #17745
Description
Cancelling a column move, with
Escapeor by settingcancelin acolumnMovinghandler, now ends the drag through the newIgxDragDirectivecancel API (cancelDrag()/cancelDragInternal()). No drop is sent anymore.IgxColumnMovingDragDirectiveusescancelDragInternal(event)onEscapeandcancelDrag()whencolumnMovingis cancelled. The drop area under the pointer gets only a leave event, so its hover state is cleared. The existingcancelDragInternaloverride resets the moving state (cms.column, theEscapesubscription).cancelMove()method and theIgxColumnMovingService.cancelDropflag (both@hidden @internal), along with its check inIgxColumnMovingDropDirective.onDragDrop.Motivation / Context
cancelMove()setcancelDrop = trueand then calledonPointerUp(), which still sent a drop to the drop area under the pointer. Only the column header drop directive checked the flag:Escapewhile dragging a column over the group-by area grouped the grid by that column.The tree grid's group-by area uses the same drop handler and had the same problem; it is fixed and covered by a test as well.
This builds on the drag cancel API from #17744 (the fix was postponed until that work was in, see the issue comment).
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Grid, Tree Grid: column moving and the group-by area (
IgxColumnMovingDragDirective,IgxColumnMovingDropDirective,IgxColumnMovingService)How Has This Been Tested?
New specs, each failing before the fix:
grid.groupby.spec.ts:Escapewhile dragging a column over the group-by area does not group by it, clears the drop area hover state, and a later pointer release does not group either.column-moving.spec.ts: after a column move cancelled withEscapeoutside the headers, the next column move is dropped and reorders the columns.tree-grid-grouping.spec.ts:Escapewhile dragging a column over the tree grid group-by area does not group by it.Also ran
column-moving,grid.groupby,tree-grid-grouping,hierarchical-grid.integration,tree-grid-integration,grid-keyBoardNav-headers,grid.multi-row-layout,columnandrow-drag.directivespecs (all passing), andnpm run lint:lib(no errors).Note: the new specs dispatch
Escapewithbubbles: true, because column moving listens forkeydownonwindow. A real key press bubbles there, but aKeyboardEventcreated withoutbubblesdoes not.Test Configuration:
Screenshots / Recordings
N/A
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)