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

Method _handleArrowDown

packages/main/src/ComboBox.ts:964–983  ·  view source on GitHub ↗
(e: KeyboardEvent, indexOfItem: number)

Source from the content-addressed store, hash-verified

962 }
963
964 _handleArrowDown(e: KeyboardEvent, indexOfItem: number) {
965 const isOpen = this.open;
966
967 if (this.focused && indexOfItem === -1 && isOpen) {
968 this.focused = false;
969 }
970
971 const allItems = this._getItems();
972 const currentItem = allItems[indexOfItem];
973 const isLastItem = indexOfItem === allItems.length - 1;
974
975 // We don't want to navigate further if the current item is the last one and either is already focused or the popover is closed
976 if (isLastItem && ((isOpen && currentItem.focused) || !isOpen)) {
977 return;
978 }
979
980 const itemIndexToBeFocused = isLastItem ? indexOfItem : indexOfItem + 1;
981
982 this._handleItemNavigation(e, itemIndexToBeFocused, true /* isForward */);
983 }
984
985 _handleArrowUp(e: KeyboardEvent, indexOfItem: number) {
986 const isOpen = this.open;

Callers

nothing calls this directly

Calls 2

_getItemsMethod · 0.95
_handleItemNavigationMethod · 0.95

Tested by

no test coverage detected