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

Method _handleKeydown

src/material/chips/chip.ts:338–345  ·  view source on GitHub ↗

Handles keyboard events on the chip.

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

336
337 /** Handles keyboard events on the chip. */
338 _handleKeydown(event: KeyboardEvent) {
339 // Ignore backspace events where the user is holding down the key
340 // so that we don't accidentally remove too many chips.
341 if ((event.keyCode === BACKSPACE && !event.repeat) || event.keyCode === DELETE) {
342 event.preventDefault();
343 this.remove();
344 }
345 }
346
347 /** Allows for programmatic focusing of the chip. */
348 focus(): void {

Callers

nothing calls this directly

Calls 1

removeMethod · 0.95

Tested by

no test coverage detected