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

Method _onkeydown

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

Source from the content-addressed store, hash-verified

916 }
917
918 _onkeydown(e: KeyboardEvent) {
919 const isArrowDownCtrl: boolean = isDownCtrl(e);
920 const isCtrl: boolean = e.metaKey || e.ctrlKey;
921
922 if (isShow(e) && !this.disabled) {
923 this._handleShow(e);
924 return;
925 }
926
927 if (isDownShift(e) || isUpShift(e)) {
928 e.preventDefault();
929 return;
930 }
931
932 if (isUp(e) || isDown(e) || isUpCtrl(e) || isArrowDownCtrl) {
933 this._handleArrowNavigation(e, isArrowDownCtrl);
934 return;
935 }
936
937 // CTRL + Arrow Down navigation is performed by the ItemNavigation module of the List,
938 // here we only implement the text selection of the selected item
939 if (isArrowDownCtrl && !this.open) {
940 setTimeout(() => this._inputDom.setSelectionRange(0, this._inputDom.value.length), 0);
941 }
942
943 if (isLeftCtrl(e) || isRightCtrl(e)) {
944 this._handleArrowCtrl(e);
945 return;
946 }
947
948 if (isInsertShift(e)) {
949 this._handleInsertPaste(e);
950 return;
951 }
952
953 if (isCtrl && e.key.toLowerCase() === "i" && this._tokenizer.tokens.length > 0) {
954 e.preventDefault();
955 this._toggleTokenizerPopover();
956 }
957
958 if (isSpaceShift(e)) {
959 e.preventDefault();
960 }
961
962 if (isCtrlAltF8(e)) {
963 return this._handleCtrlALtF8();
964 }
965
966 if (
967 e.key === "ArrowLeft"
968 || e.key === "ArrowRight"
969 || e.key === "Show"
970 || e.key === "PageUp"
971 || e.key === "PageDown"
972 || e.key === "Backspace"
973 || e.key === "Escape"
974 || e.key === "Home"
975 || e.key === "End"

Callers

nothing calls this directly

Calls 15

_handleShowMethod · 0.95
_handleArrowCtrlMethod · 0.95
_handleInsertPasteMethod · 0.95
_handleCtrlALtF8Method · 0.95
isDownCtrlFunction · 0.85
isShowFunction · 0.85
isDownShiftFunction · 0.85
isUpShiftFunction · 0.85
isUpFunction · 0.85
isDownFunction · 0.85

Tested by

no test coverage detected