Repository navigation
Conversation
…puts Use an invariant structural union check in TcbNativeFieldOp for numeric and date inputs, matching the existing check used for text inputs. Previously, these inputs used a covariant read-only check that allowed non-nullable Field<number> on <input type="number"> and Field<Date> on <input type="date">, even though clearing the input writes null to the model signal at runtime. - number, datetime-local: string | number | null (invariant) - range: string | number | number | null (invariant) - date, month, time, week: string | number | Date | null (invariant) Fixes angular#72230
8efa053 to
7bacdee
Compare
|
Just as a note the age/rating example is still using non nullable numbers and isn't covered by #72217 angular/adev/src/content/guide/forms/signals/validation.md Lines 181 to 216 in 63fa515 I checked it against the base commit and this PR: it compiles before the change, but both |
Good catch, thanks @SkyZeroZx. I checked the rest of the guides and found a few more snippets that bind a non-nullable
Two of them also compare the value with @JeanMeche I can send a follow-up docs PR for these once #72217 lands, unless you'd rather include them in this PR. |
Draft PR to test TGP impact of enforcing invariant nullable types on native numeric and date
[formField]bindings.Uses the same invariant structural union check in
TcbNativeFieldOpthat<input type="text">already uses:number,datetime-local:Field<string> | Field<number | null>range:Field<string> | Field<number> | Field<number | null>date,month,time,week:Field<string> | Field<number> | Field<Date | null>Fixes #72230