You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Query Builder] Refactor, bug fixing and test coverage improved - #17706
Raises Query Builder unit test coverage from 88.7% to ~98.4% (lines).
Fixes several bugs that ware exposed during refactor. Added test for them.
Removes dead code.
Fixes
Keyboard drag: pressing Space did nothing, because the listener checked for 'Space' while the browser reports ' '. Pressing Space or Enter before choosing a drop location deleted the dragged expression. Both keys now drop only once a drop ghost is shown.
During Keyboard drag:, ArrowUp/ArrowDown and the Space/Enter key that drops now call preventDefault() (held keys included), so the page/container no longer scrolls.
During Keyboard drag:, Tab and Shift+Tab are ignored while the drop ghost is shown, so focus stays on it until the condition is dropped (Enter/Space) or the drag is cancelled (Escape). Previously they cancelled the drag and focus was lost.
Mouse drag + keyboard: while a chip is held with the mouse and its drop ghost is shown, tabbing to another chip's drag indicator let ArrowUp/ArrowDown move the drop ghost without moving the mouse, and Space/Enter drop the mouse-dragged chip there. Added a guard that prevents keyboard drag while a mouse drag is in progress.
Time fields: selecting a time field without editorOptions threw an error (editorOptions!.dateTimeFormat, now ?.).
Unreachable code removed (all private/protected/@hidden @internal; IgxQueryBuilderTreeComponent is not exported):
addRootAndGroupButton@ViewChild, whose template ref no longer exists (setAddButtonFocus keeps its behavior)
_expandedExpressions, which was never written to
String handling for _selectedReturnFields, which is always an array; the type is narrowed to string[]
The unreachable 'wrong key' branch in arrowDrag; the key is typed as 'ArrowUp' | 'ArrowDown'
Tests
New specs for: add-menu flows (add group, add-mode transitions, nested query), focus/blur, return fields, time/dateTime/currency/percent/untyped fields, an entity without fields, return-field chip text, commit()/setAddButtonFocus(), the drag service (no-op events, re-targeting, release outside a drop area, focus-out cancel, focus moving to the drop ghost), AND/OR switch before the first commit, and resource strings.
Re-enabled the disabled xit drop-ghost spec. Its hard-coded pointer offsets missed the drop target, so it now moves the pointer to the measured "Add condition" button.
Motivation / Context
Improve Query Builder test coverage.
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:
Query Builder (also used by grid advanced filtering)
How Has This Been Tested?
Unit tests
Manual testing
Automated e2e tests
All query-builder specs and the non-grid suite pass. All specs that open grid advanced filtering pass (390). npm run lint:lib reports no errors.
Test Configuration:
Angular version: 22
Browser(s): Chrome Headless
OS: Windows 11
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
Cancel the activation key's default action here. When a drop ghost exists, the chip's invokeClick handler deliberately does nothing, so a real Space keydown reaches this branch without any preventDefault() call and can scroll the page while committing the reorder.
The newly supported real Space key (' ') still performs its native browser action because this branch never cancels the keydown. When the drag indicator is focused, the page can scroll at the same time the condition is dropped. Prevent the default action before committing the drop (and make the corresponding test event cancelable if asserting this behavior).
ivanvpetrov
changed the title
test(query-builder): coverage improved
Query Builder: Refactor, bug fixing and test coverage improved
Oct 6, 2026
ivanvpetrov
changed the title
Query Builder: Refactor, bug fixing and test coverage improved
[Query Builder] Refactor, bug fixing and test coverage improved
Oct 6, 2026
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
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.
Description
Fixes
'Space'while the browser reports' '. Pressing Space or Enter before choosing a drop location deleted the dragged expression. Both keys now drop only once a drop ghost is shown.TabandShift+Tabare ignored while the drop ghost is shown, so focus stays on it until the condition is dropped (Enter/Space) or the drag is cancelled (Escape). Previously they cancelled the drag and focus was lost.timefield withouteditorOptionsthrew an error (editorOptions!.dateTimeFormat, now?.).Unreachable code removed (all
private/protected/@hidden @internal;IgxQueryBuilderTreeComponentis not exported):editingInputsContainer,currentGroupButtonsContainer),endGroup(),onKeyDown()addRootAndGroupButton@ViewChild, whose template ref no longer exists (setAddButtonFocuskeeps its behavior)_expandedExpressions, which was never written to_selectedReturnFields, which is always an array; the type is narrowed tostring[]'wrong key'branch inarrowDrag; the key is typed as'ArrowUp' | 'ArrowDown'Tests
commit()/setAddButtonFocus(), the drag service (no-op events, re-targeting, release outside a drop area, focus-out cancel, focus moving to the drop ghost), AND/OR switch before the first commit, and resource strings.xitdrop-ghost spec. Its hard-coded pointer offsets missed the drop target, so it now moves the pointer to the measured "Add condition" button.Motivation / Context
Improve Query Builder test coverage.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Query Builder (also used by grid advanced filtering)
How Has This Been Tested?
All query-builder specs and the non-grid suite pass. All specs that open grid advanced filtering pass (390).
npm run lint:libreports no errors.Test Configuration:
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)