@angular/forms 21.1.0 → 21.2.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.1.0
2
+ * @license Angular v21.2.0-next.0
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1178,8 +1178,8 @@ class FieldNode {
1178
1178
  this.metadataState = new FieldMetadataState(this);
1179
1179
  this.submitState = new FieldSubmitState(this);
1180
1180
  }
1181
- focusBoundControl() {
1182
- this.getBindingForFocus()?.focus();
1181
+ focusBoundControl(options) {
1182
+ this.getBindingForFocus()?.focus(options);
1183
1183
  }
1184
1184
  getBindingForFocus() {
1185
1185
  const own = this.formFieldBindings().filter(b => b.focus !== undefined).reduce(firstInDom, undefined);
@@ -1278,9 +1278,10 @@ class FieldNode {
1278
1278
  return this.metadataState.has(key);
1279
1279
  }
1280
1280
  markAsTouched() {
1281
- this.nodeState.markAsTouched();
1282
- this.pendingSync()?.abort();
1283
- this.sync();
1281
+ untracked(() => {
1282
+ this.nodeState.markAsTouched();
1283
+ this.flushSync();
1284
+ });
1284
1285
  }
1285
1286
  markAsDirty() {
1286
1287
  this.nodeState.markAsDirty();
@@ -1299,13 +1300,22 @@ class FieldNode {
1299
1300
  }
1300
1301
  }
1301
1302
  setControlValue(newValue) {
1302
- this._controlValue.set(newValue);
1303
- this.markAsDirty();
1304
- this.debounceSync();
1303
+ untracked(() => {
1304
+ this._controlValue.set(newValue);
1305
+ this.markAsDirty();
1306
+ this.debounceSync();
1307
+ });
1305
1308
  }
1306
1309
  sync() {
1307
1310
  this.value.set(this.controlValue());
1308
1311
  }
1312
+ flushSync() {
1313
+ const pending = this.pendingSync();
1314
+ if (pending && !pending.signal.aborted) {
1315
+ pending.abort();
1316
+ this.sync();
1317
+ }
1318
+ }
1309
1319
  async debounceSync() {
1310
1320
  this.pendingSync()?.abort();
1311
1321
  const debouncer = this.nodeState.debouncer();