MCPcopy Index your code
hub / github.com/UI5/webcomponents / _onItemKeydown

Method _onItemKeydown

packages/main/src/MultiComboBox.ts:1217–1284  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

1215 }
1216
1217 _onItemKeydown(e: KeyboardEvent) {
1218 const isFirstItemGroup = this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[1] === e.target && this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[0].hasAttribute("ui5-li-group");
1219 const isFirstItem = this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[0] === e.target || isFirstItemGroup;
1220 const isArrowUp = isUp(e) || isUpCtrl(e);
1221
1222 if (this.hasValueStateMessage && !this.valueStateHeader) {
1223 this._setValueStateHeader();
1224 }
1225
1226 if (isTabNext(e) || isTabPrevious(e)) {
1227 this._onItemTab();
1228 return;
1229 }
1230
1231 if (isHomeCtrl(e)) {
1232 this.list?._itemNavigation._handleHome();
1233 this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[this.list?._itemNavigation._currentIndex].focus();
1234 }
1235
1236 if (isEndCtrl(e)) {
1237 this.list?._itemNavigation._handleEnd();
1238 this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[this.list?._itemNavigation._currentIndex].focus();
1239 }
1240
1241 e.preventDefault();
1242
1243 if (isCtrlAltF8(e)) {
1244 return this._handleCtrlALtF8();
1245 }
1246
1247 if (isDownShift(e) || isUpShift(e)) {
1248 this._handleItemRangeSelection(e);
1249 return;
1250 }
1251
1252 if ((isUpCtrl(e)) && !isFirstItem) {
1253 this.list?._itemNavigation._handleUp();
1254 this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[this.list?._itemNavigation._currentIndex].focus();
1255 }
1256
1257 if (isDownCtrl(e)) {
1258 this.list?._itemNavigation._handleDown();
1259 this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[this.list?._itemNavigation._currentIndex].focus();
1260 }
1261
1262 if (isShow(e)) {
1263 this._toggleTokenizerPopover();
1264 }
1265
1266 if (isCtrlA(e)) {
1267 this._handleSelectAll();
1268 return;
1269 }
1270
1271 if (isFirstItem && isArrowUp) {
1272 if (this.showSelectAll) {
1273 if (isFirstItemGroup) {
1274 this.list?.getSlottedNodes<IMultiComboBoxItem>("items")[0].focus();

Callers

nothing calls this directly

Calls 15

_setValueStateHeaderMethod · 0.95
_onItemTabMethod · 0.95
_handleCtrlALtF8Method · 0.95
_handleSelectAllMethod · 0.95
_getResponsivePopoverMethod · 0.95
isUpFunction · 0.85
isUpCtrlFunction · 0.85
isTabNextFunction · 0.85
isTabPreviousFunction · 0.85
isHomeCtrlFunction · 0.85

Tested by

no test coverage detected