MCPcopy Create free account
hub / github.com/UI5/webcomponents / _applyAtomicValueAndSelection

Method _applyAtomicValueAndSelection

packages/main/src/ComboBox.ts:1274–1288  ·  view source on GitHub ↗
(item: IComboBoxItem, filterValue: string)

Source from the content-addressed store, hash-verified

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);

Callers 1

_handleTypeAheadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected