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

Method _searchNextItemByText

packages/main/src/Select.ts:751–759  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

749 }
750
751 _searchNextItemByText(text: string) {
752 let orderedOptions = this.options.slice(0);
753 const optionsAfterSelected = orderedOptions.splice(this._selectedIndex + 1, orderedOptions.length - this._selectedIndex);
754 const optionsBeforeSelected = orderedOptions.splice(0, orderedOptions.length - 1);
755
756 orderedOptions = optionsAfterSelected.concat(optionsBeforeSelected);
757
758 return orderedOptions.find(option => option.effectiveDisplayText.toLowerCase().startsWith(text));
759 }
760
761 _handleHomeKey(e: KeyboardEvent) {
762 e.preventDefault();

Callers 1

_selectTypedItemMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected