Handles keyboard events on the chip.
(event: KeyboardEvent)
| 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 { |