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

Method _handleKeydown

src/material/chips/chip.ts:359–366  ·  view source on GitHub ↗

Handles keyboard events on the chip.

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

357
358 /** Handles keyboard events on the chip. */
359 _handleKeydown(event: KeyboardEvent) {
360 // Ignore backspace events where the user is holding down the key
361 // so that we don't accidentally remove too many chips.
362 if ((event.keyCode === BACKSPACE && !event.repeat) || event.keyCode === DELETE) {
363 event.preventDefault();
364 this.remove();
365 }
366 }
367
368 /** Allows for programmatic focusing of the chip. */
369 focus(): void {

Callers

nothing calls this directly

Calls 1

removeMethod · 0.95

Tested by

no test coverage detected