(e: KeyboardEvent)
| 708 | } |
| 709 | |
| 710 | _handleKeyboardNavigation(e: KeyboardEvent) { |
| 711 | if (this.readonly) { |
| 712 | return; |
| 713 | } |
| 714 | |
| 715 | const typedCharacter = e.key.toLowerCase(); |
| 716 | |
| 717 | this._typedChars += typedCharacter; |
| 718 | |
| 719 | // We check if we have more than one characters and they are all duplicate, we set the |
| 720 | // text to be the last input character (typedCharacter). If not, we set the text to be |
| 721 | // the whole input string. |
| 722 | |
| 723 | const text = (/^(.)\1+$/i).test(this._typedChars) ? typedCharacter : this._typedChars; |
| 724 | |
| 725 | clearTimeout(this._typingTimeoutID); |
| 726 | |
| 727 | this._typingTimeoutID = setTimeout(() => { |
| 728 | this._typedChars = ""; |
| 729 | this._typingTimeoutID = -1; |
| 730 | }, 1000); |
| 731 | |
| 732 | this._selectTypedItem(text); |
| 733 | } |
| 734 | |
| 735 | _selectTypedItem(text: string) { |
| 736 | const currentIndex = this._selectedIndex; |
no test coverage detected