Repository navigation
fix(forms): gate invalid state on touched or dirty - #17740
Open
viktorkombov wants to merge 2 commits into
Open
viktorkombov wants to merge 2 commits into
viktorkombov wants to merge 2 commits into
Conversation
…into vkombov/fix-17671-22.2.x
viktorkombov
requested review from
rkaraivanov
and
a balanced review from Copilot
October 7, 2026 09:57
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation consistently addresses the reported ordering issue and includes targeted regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
This PR aligns Signal Forms invalid styling with reactive/template-driven forms by gating invalid state until controls are touched or dirty.
Changes:
- Gates checkbox, switch, radio, and radio-group invalid states.
- Correctly propagates radio-group invalid and touched states.
- Adds regression tests, documentation, and changelog coverage.
| File | Description |
|---|---|
CHANGELOG.md |
Documents the Signal Forms fix. |
skills/igniteui-angular-components/references/form-controls.md |
Clarifies invalid-state behavior. |
projects/igniteui-angular/directives/src/directives/checkbox/checkbox-base.directive.ts |
Centralizes invalid-state gating. |
projects/igniteui-angular/checkbox/src/checkbox/checkbox.component.ts |
Delegates invalid state to the base directive. |
projects/igniteui-angular/checkbox/src/checkbox/checkbox.component.spec.ts |
Tests reset behavior. |
projects/igniteui-angular/switch/src/switch/switch.component.ts |
Delegates invalid state to the base directive. |
projects/igniteui-angular/switch/src/switch/switch.component.spec.ts |
Tests conditional validation. |
projects/igniteui-angular/radio/src/radio/radio.component.ts |
Supports group-driven invalid propagation. |
projects/igniteui-angular/radio/src/radio/radio-group/radio-group.directive.ts |
Gates and propagates group invalid state. |
projects/igniteui-angular/radio/src/radio/radio-group/radio-group.directive.spec.ts |
Tests reset behavior. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
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 #17671
Description
With
[formField], Angular writes the field's rawinvalid()into theinvalidinput ofigx-checkbox,igx-switchandigx-radio-groupwhenever it changes, bypassing the touched-or-dirty rule these controls apply for reactive and template-driven forms — e.g. a pristine field painted the error style right afterreset()or when a cross-field rule made it required. Same ordering issue #17637 fixed forrequired.invalidis now a gated setter onCheckboxBaseDirectiveandIgxRadioGroupDirective: with a bound form control,trueis coerced tofalsewhile the control is untouched and pristine (checkbox/switch/radio became delegating accessors to keep@Input/@HostBinding).invalidfrom the control on status changes instead of always clearing it, since Signal Forms only push validity on change.registerOnTouchednever reaching the radio buttons (the forms directive registers before any buttons exist), so blur now marks the field touched.Tests: 3 new regression specs (fail without the fix); full non-grid suite green (3386), lint clean. Changelog updated; no API changes.
🤖 Generated with Claude Code
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
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)