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