Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
Issue number: resolves #31405
What is the current behavior?
Currently, Ionic form controls bound with Angular signal forms (
[formField]) don't getion-touched,ion-invalidand the other status classes when the form state changes in code. CallingmarkAsTouched()never shows theerrorText, and a cross-field validator never marks the other input invalid. WithoutprovideSignalFormsConfig({ classes: NG_STATUS_CLASSES })there are noion-*classes at all, because we copy them from Angular'sng-*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 theion-*classes from the control's state inside aneffect, so they update whenever that state changes. The checkbox and togglewriteValueoverrides pass the control along too, so they don't overwrite those classes. A field with an async validator still running gets neitherion-validnorion-invalid, matching Angular's own classes. Reactive and template-driven forms go through the same path as before.Does this introduce a breaking change?
But it is a new feature, which is why it's pointed at
feature-9.1Other information
Signal forms don't compile on Angular 18-20, so the test pages only exist in the
ng22andng22-zoneapps. Base now has an emptyversion-test.routes.tsfor/lazyand/standalonethat those apps override, and I added a note about it todocs/angular/testing.md.Signal forms test page
Relevant docs PR: ionic-team/ionic-docs#4893