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

Method _keydown

src/material/chips/chip-input.ts:160–171  ·  view source on GitHub ↗

Utility method to make host definition/tests more clear.

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

158
159 /** Utility method to make host definition/tests more clear. */
160 _keydown(event: KeyboardEvent) {
161 if (this.empty && event.keyCode === BACKSPACE) {
162 // Ignore events where the user is holding down backspace
163 // so that we don't accidentally remove too many chips.
164 if (!event.repeat) {
165 this._chipGrid._focusLastChip();
166 }
167 event.preventDefault();
168 } else {
169 this._emitChipEnd(event);
170 }
171 }
172
173 /** Checks to see if the blur should emit the (chipEnd) event. */
174 _blur() {

Callers 1

onKeydownMethod · 0.45

Calls 2

_emitChipEndMethod · 0.95
_focusLastChipMethod · 0.80

Tested by

no test coverage detected