| 1272 | } |
| 1273 | |
| 1274 | _applyAtomicValueAndSelection(item: IComboBoxItem, filterValue: string) { |
| 1275 | const value = (item && item.text) || ""; |
| 1276 | |
| 1277 | this.inner.value = value; |
| 1278 | |
| 1279 | // select the whole value if it doesn't start with the filterValue, otherwise select only the autocompleted part |
| 1280 | const startsWithFilter = value.toLowerCase().startsWith(filterValue.toLowerCase()); |
| 1281 | const selectionStart = startsWithFilter ? filterValue.length : 0; |
| 1282 | this.inner.setSelectionRange(selectionStart, value.length); |
| 1283 | this.value = value; |
| 1284 | |
| 1285 | if (this._useSelectedValue) { |
| 1286 | this.selectedValue = item.value; |
| 1287 | } |
| 1288 | } |
| 1289 | |
| 1290 | _selectMatchingItem() { |
| 1291 | const currentlyFocusedItem = this.items.find(item => item.focused); |