Skip to content

feat(angular): apply form status classes with signal forms - #31813

Open
ShaneK wants to merge 1 commit into
feature-9.1from
FW-7897
Open

ShaneK wants to merge 1 commit into
feature-9.1from
FW-7897

Conversation

@ShaneK

@ShaneK ShaneK commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Issue number: resolves #31405


What is the current behavior?

Currently, Ionic form controls bound with Angular signal forms ([formField]) don't get ion-touched, ion-invalid and the other status classes when the form state changes in code. Calling markAsTouched() never shows the errorText, and a cross-field validator never marks the other input invalid. Without provideSignalFormsConfig({ classes: NG_STATUS_CLASSES }) there are no ion-* classes at all, because we copy them from Angular's ng-* classes and only on our own blur and input events.

What is the new behavior?

When the bound control has no statusChanges, which is the case for signal forms, we now build the ion-* classes from the control's state inside an effect, so they update whenever that state changes. The checkbox and toggle writeValue overrides pass the control along too, so they don't overwrite those classes. A field with an async validator still running gets neither ion-valid nor ion-invalid, matching Angular's own classes. Reactive and template-driven forms go through the same path as before.

Does this introduce a breaking change?

  • Yes
  • No

But it is a new feature, which is why it's pointed at feature-9.1

Other information

Signal forms don't compile on Angular 18-20, so the test pages only exist in the ng22 and ng22-zone apps. Base now has an empty version-test.routes.ts for /lazy and /standalone that those apps override, and I added a note about it to docs/angular/testing.md.

Signal forms test page

Relevant docs PR: ionic-team/ionic-docs#4893

@ShaneK
ShaneK requested a review from a team as a code owner November 23, 2026 22:46
@ShaneK
ShaneK requested a review from thetaPC November 23, 2026 22:46
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 23, 2026 10:48pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — ab08e6f5 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant