(options?: MarkAsTouchedOptions)
| 279 | } |
| 280 | |
| 281 | markAsTouchedInternal(options?: MarkAsTouchedOptions): void { |
| 282 | if (this.structure.isOrphaned()) { |
| 283 | return; |
| 284 | } |
| 285 | const skipValidation = this.validationState.shouldSkipValidation(); |
| 286 | if (!skipValidation) { |
| 287 | this.nodeState.markAsTouched(); |
| 288 | } |
| 289 | // Flush even when validation is skipped: the debounce writes the value anyway, and flushing |
| 290 | // makes it land before a submit action reads the model. |
| 291 | this.flushSync(); |
| 292 | if (options?.skipDescendants) { |
| 293 | return; |
| 294 | } |
| 295 | // Inactive subtrees stay lazy: only fields that already exist can have a pending value. |
| 296 | const children = skipValidation |
| 297 | ? this.structure.materializedChildren() |
| 298 | : this.structure.children(); |
| 299 | for (const child of children) { |
| 300 | child.markAsTouchedInternal(); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | /** |
| 305 | * Marks this specific field as dirty. |
no test coverage detected