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

Method _blur

src/material/chips/chip-grid.ts:421–434  ·  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

419
420 /** When blurred, mark the field as touched when focus moved outside the chip grid. */
421 _blur() {
422 if (!this.disabled) {
423 // Check whether the focus moved to chip input.
424 // If the focus is not moved to chip input, mark the field as touched. If the focus moved
425 // to chip input, do nothing.
426 // Timeout is needed to wait for the focus() event trigger on chip input.
427 setTimeout(() => {
428 if (!this.focused) {
429 this._propagateChanges();
430 this._markAsTouched();
431 }
432 });
433 }
434 }
435
436 /**
437 * 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