MCPcopy
hub / github.com/angular/components / _blur

Method _blur

src/material/chips/chip-grid.ts:419–432  ·  view source on GitHub ↗

When blurred, mark the field as touched when focus moved outside the chip grid.

()

Source from the content-addressed store, hash-verified

417
418 /** When blurred, mark the field as touched when focus moved outside the chip grid. */
419 _blur() {
420 if (!this.disabled) {
421 // Check whether the focus moved to chip input.
422 // If the focus is not moved to chip input, mark the field as touched. If the focus moved
423 // to chip input, do nothing.
424 // Timeout is needed to wait for the focus() event trigger on chip input.
425 setTimeout(() => {
426 if (!this.focused) {
427 this._propagateChanges();
428 this._markAsTouched();
429 }
430 });
431 }
432 }
433
434 /**
435 * Removes the `tabindex` from the chip grid and resets it back afterwards, allowing the

Callers 2

ngAfterContentInitMethod · 0.95
chip-input.spec.tsFile · 0.45

Calls 2

_propagateChangesMethod · 0.95
_markAsTouchedMethod · 0.95

Tested by

no test coverage detected