(current: string)
| 1249 | } |
| 1250 | |
| 1251 | _getFirstMatchingItem(current: string): IComboBoxItem | void { |
| 1252 | const allItems = this._getItems(); |
| 1253 | const currentlyFocusedItem = allItems.find(item => item.focused === true); |
| 1254 | |
| 1255 | if (currentlyFocusedItem?.isGroupItem) { |
| 1256 | this.value = this.filterValue; |
| 1257 | return; |
| 1258 | } |
| 1259 | |
| 1260 | const matchingItems: Array<IComboBoxItem> = this._startsWithMatchingItems(current); |
| 1261 | |
| 1262 | if (matchingItems.length) { |
| 1263 | let exactMatch; |
| 1264 | if (this._useSelectedValue) { |
| 1265 | exactMatch = matchingItems.find(item => item.value === (currentlyFocusedItem?.value || this.selectedValue) && item.text?.toLowerCase() === current.toLowerCase()); |
| 1266 | } else { |
| 1267 | exactMatch = matchingItems.find(item => item.text?.toLowerCase() === current.toLowerCase()); |
| 1268 | } |
| 1269 | |
| 1270 | return exactMatch ?? matchingItems[0]; |
| 1271 | } |
| 1272 | } |
| 1273 | |
| 1274 | _applyAtomicValueAndSelection(item: IComboBoxItem, filterValue: string) { |
| 1275 | const value = (item && item.text) || ""; |
no test coverage detected