(e: KeyboardEvent)
| 1029 | } |
| 1030 | |
| 1031 | _handleEnter(e: KeyboardEvent) { |
| 1032 | // if a group item is focused, this is false |
| 1033 | const suggestionItemPressed = !!(this.Suggestions?.onEnter(e)); |
| 1034 | const innerInput = this.getInputDOMRefSync()!; |
| 1035 | |
| 1036 | let matchingItem = this._matchedSuggestionItem; |
| 1037 | if (!matchingItem) { |
| 1038 | matchingItem = this._selectableItems.find(item => { |
| 1039 | return item.text?.toLowerCase() === this.value.toLowerCase(); |
| 1040 | }); |
| 1041 | } |
| 1042 | |
| 1043 | if (matchingItem) { |
| 1044 | const itemText = matchingItem.text || ""; |
| 1045 | |
| 1046 | innerInput.setSelectionRange(itemText.length, itemText.length); |
| 1047 | if (!suggestionItemPressed) { |
| 1048 | this.fireSelectionChange(matchingItem, true); |
| 1049 | this.acceptSuggestion(matchingItem, true); |
| 1050 | this.open = false; |
| 1051 | } |
| 1052 | } |
| 1053 | |
| 1054 | if (this._isPhone && !this._flattenItems.length && !this.isTypeNumber) { |
| 1055 | innerInput.setSelectionRange(this.value.length, this.value.length); |
| 1056 | } |
| 1057 | |
| 1058 | if (!suggestionItemPressed) { |
| 1059 | this.lastConfirmedValue = this.value; |
| 1060 | |
| 1061 | return; |
| 1062 | } |
| 1063 | |
| 1064 | this.focused = true; |
| 1065 | } |
| 1066 | |
| 1067 | _handlePageUp(e: KeyboardEvent) { |
| 1068 | if (this._isSuggestionsFocused) { |
no test coverage detected