Repository navigation
feat(query-builder): cancel condition mouse drag on Escape - #17768
Draft
ivanvpetrov wants to merge 2 commits into
Draft
ivanvpetrov wants to merge 2 commits into
ivanvpetrov wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation matches the stated requirements and includes comprehensive regression coverage.
0 open findings
What changed in this PR
Adds Escape cancellation for Query Builder condition mouse drags while preserving keyboard drag behavior and focus recovery.
Changes:
- Enables
cancelOnEscapeand prevents cancelled drags from committing. - Restores keyboard dragging for indicators focused during an aborted mouse drag.
- Adds regression tests and changelog entries.
| File | Description |
|---|---|
query-builder.component.spec.ts |
Tests cancellation, subsequent drags, and focus recovery. |
query-builder-tree.component.html |
Passes chip and move-end event data to the drag service. |
query-builder-drag.service.ts |
Implements cancellation handling and keyboard-drag recovery. |
CHANGELOG.md |
Documents the new behavior and related fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
ivanvpetrov
changed the base branch from
ipetrov/qb-drag-base
to
ipetrov/drag-cancel-upon-escape
October 19, 2026 07:42
kdinev
force-pushed
the
ipetrov/drag-cancel-upon-escape
branch
from
October 19, 2026 07:59
456c723 to
9d0760f
Compare
ivanvpetrov
force-pushed
the
ipetrov/qb-cancel-drag-upon-escape
branch
from
October 19, 2026 08:41
23b20e1 to
4dee85b
Compare
ivanvpetrov
changed the base branch from
ipetrov/drag-cancel-upon-escape
to
master
October 19, 2026 08:50
ivanvpetrov
changed the base branch from
master
to
ipetrov/drag-cancel-upon-escape
October 19, 2026 08:50
ivanvpetrov
marked this pull request as ready for review
October 19, 2026 08:50
ivanvpetrov
marked this pull request as draft
October 19, 2026 08:51
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 #17749
Description
Pressing
Escapewhile dragging a Query Builder condition with the mouse now cancels the drag. The condition stays where it was and is not dropped when the mouse button is released.dragDirective.cancelOnEscapeis set totrue(no new chip API).onMoveEnd()receives the chip'smoveEndargs and does not drop whenoriginalEvent.cancelledistrue.igxDragcancels the drag instead. Escape during a keyboard drag works as before.igxDragstops the Escape that cancels the drag, it doesn't also close a surrounding dialog (e.g. Advanced Filtering).Related fix: if another condition's drag indicator gets focus during a mouse drag, that focus is ignored, which is correct. But once the mouse drag ended without a drop (cancelled with Escape, or released outside a drop area),
Arrow Up/Arrow Downon that indicator still did nothing until it was focused again. Now a keyboard drag starts for the focused indicator when the mouse drag ends. The release-outside-a-drop-area case was already broken before this PR.Motivation / Context
#17744 added
cancelDrag()andcancelOnEscapetoigxDrag. This PR uses them in the Query Builder, as described in #17749.Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Query Builder (condition drag and drop)
How Has This Been Tested?
New and updated specs in
query-builder.component.spec.ts, each failing before the change:Escape during a mouse drag cancels it:
moveEndreportscancelled, the source condition is shown again, the expression tree is unchanged, and releasing the mouse afterwards doesn't drop.cancelDrag()during a mouse drag doesn't drop.A mouse drag after a cancelled one drops as usual.
After a mouse drag is cancelled with Escape, the drag indicator focused during it starts a keyboard drag with
Arrow Up, andSpacedrops that condition.After a mouse drag is released outside a drop area, the drag indicator focused during it starts a keyboard drag (extended the existing test).
Unit tests
Manual testing
Automated e2e tests
Test Configuration:
Screenshots / Recordings
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)