Skip to content

Comments

Recreate filtering expression condition based on correct condition.Name value [master]#16902

Merged
hanastasov merged 5 commits intomasterfrom
keep-conditionName-insync
Feb 17, 2026
Merged

Recreate filtering expression condition based on correct condition.Name value [master]#16902
hanastasov merged 5 commits intomasterfrom
keep-conditionName-insync

Conversation

@hanastasov
Copy link
Contributor

@hanastasov hanastasov commented Feb 13, 2026

conditionName is used to recreate expression.condition when restoring grid state from IgxGridState directive. Without this fix, restoring grid state would change condition from whatever it was to the default condition "contains"

Solution:

  1. When restoring, give preference to condition.name over conditionName
  2. Update conditionName = condition.name

What to reproduce and verify:

  1. Use the sample in the issue
  2. Add filtering condition different than contains
  3. Save grid state
  4. Restore grid state - condition is restored to contains, not to what user has set.

Closes #16841

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the extracted filter column state was incorrectly being set to "contains" instead of the actual selected condition when users changed filter conditions or restored grid state.

Changes:

  • Prioritized condition.name over conditionName when recreating filter expressions to ensure the correct source of truth is used
  • Made conditionName always sync with condition.name after recreation, removing the conditional check
  • Added test coverage for the scenario where conditionName and condition.name are out of sync

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
projects/igniteui-angular/core/src/data-operations/expressions-tree-util.ts Fixed priority order in recreateOperatorFromDataType and recreateExpression to use condition.name before conditionName; ensured conditionName is always synced with condition.name; exported recreateExpression function for testing
projects/igniteui-angular/core/src/data-operations/expressions-tree-util.spec.ts Added test case to verify that expressions with mismatched conditionName and condition.name are correctly recreated with the proper conditionName

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.572% (-0.001%) from 91.573%
when pulling cfd0ebe on keep-conditionName-insync
into b3fb7ad on master.

@deyvidnenchev deyvidnenchev added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Feb 16, 2026
@hanastasov hanastasov changed the title test(test): assert if correct condition is recreated based on conditi… Recreate filtering expression condition based on correct condition.Name value [master] Feb 17, 2026
@hanastasov hanastasov merged commit 4dd351e into master Feb 17, 2026
6 checks passed
@hanastasov hanastasov deleted the keep-conditionName-insync branch February 17, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filtering grid: state-persistence ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid State - Extracted filter column state is always set to "contains"

4 participants