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

Method updateValueOnSelect

packages/main/src/Input.ts:1587–1597  ·  view source on GitHub ↗

* Updates the input value on item select. * @param item The item that is on select

(item: IInputSuggestionItem)

Source from the content-addressed store, hash-verified

1585 * @param item The item that is on select
1586 */
1587 updateValueOnSelect(item: IInputSuggestionItem) {
1588 const itemValue = this._isGroupItem(item) ? this.valueBeforeSelectionStart : (item as IInputSuggestionItemSelectable).text;
1589
1590 this.value = itemValue || "";
1591 this._performTextSelection = true;
1592
1593 // Update the matched item when navigating with arrows to preserve correct case on Enter
1594 if (!this._isGroupItem(item)) {
1595 this._matchedSuggestionItem = item as IInputSuggestionItemSelectable;
1596 }
1597 }
1598
1599 fireEventByAction(action: INPUT_ACTIONS, e: InputEvent) {
1600 const valueBeforeInput = this.value;

Callers 1

onItemSelectMethod · 0.95

Calls 1

_isGroupItemMethod · 0.95

Tested by

no test coverage detected