Commit e8eb5b9
committed
fix(forms/signals): propagate pending state through grandchild fields
The `pending()` signal only checked direct children's `asyncErrors` for
pending sentinels, so a grandchild's async validator would not bubble the
pending state up to the grandparent. This caused `InteropNgControl.status`
to throw an AssertionError when the field tree had three or more levels and
an async validator was placed on a grandchild field (status was 'unknown'
but `pending()` returned false).
- Fix `FieldValidationState.pending` to recursively call
`child.validationState.pending()` instead of checking
`child.validationState.asyncErrors().includes('pending')`.
- Replace the unreachable `throw` in `InteropNgControl.status` with a
defensive `return 'PENDING'` fallback that correctly maps the 'unknown'
validation status to Angular's FormControlStatus.
- Add a regression test for the grandchild pending propagation scenario.
https://claude.ai/code/session_01VdGf6HYafkbRfpEBJYL9Te1 parent 59e6489 commit e8eb5b9
File tree
3 files changed
+38
-7
lines changed- packages/forms/signals
- src
- controls
- field
- test/node
3 files changed
+38
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 117 | | |
121 | 118 | | |
122 | 119 | | |
123 | | - | |
124 | | - | |
| 120 | + | |
| 121 | + | |
125 | 122 | | |
126 | | - | |
| 123 | + | |
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
419 | 453 | | |
420 | 454 | | |
421 | 455 | | |
| |||
0 commit comments