MCPcopy Create free account
hub / github.com/angular/components / _onBlur

Method _onBlur

src/material/checkbox/checkbox.ts:456–466  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

454 }
455
456 _onBlur() {
457 // When a focused element becomes disabled, the browser *immediately* fires a blur event.
458 // Angular does not expect events to be raised during change detection, so any state change
459 // (such as a form control's 'ng-touched') will cause a changed-after-checked error.
460 // See https://github.com/angular/angular/issues/17793. To work around this, we defer
461 // telling the form control it has been touched until the next tick.
462 Promise.resolve().then(() => {
463 this._onTouched();
464 this._changeDetectorRef.markForCheck();
465 });
466 }
467
468 private _getAnimationClassForCheckStateTransition(
469 oldState: TransitionCheckState,

Callers

nothing calls this directly

Calls 3

resolveMethod · 0.80
_onTouchedMethod · 0.80
markForCheckMethod · 0.80

Tested by

no test coverage detected