@@ -217,7 +217,6 @@ const handleContextRightClickMenu = e => {
217
217
/* 下拉菜单 */
218
218
const showSearchDropdownRef = ref(false);
219
219
const searchDropdownOptions = ref([]);
220
- let isInMenuSelection = false;
221
220
222
221
const getCurrentCursorIndex = () => {
223
222
return term.buffer.normal.cursorX;
@@ -317,7 +316,6 @@ const handleSearchSelect = (key, option) => {
317
316
}
318
317
319
318
showSearchDropdownRef.value = false;
320
- isInMenuSelection = false;
321
319
};
322
320
323
321
async function initConnect() {
@@ -376,7 +374,6 @@ const hideDropdownMenu = e => {
376
374
if (e?.toElement?.className.indexOf('n-dropdown') !== -1) {
377
375
return;
378
376
}
379
- isInMenuSelection = false;
380
377
showSearchDropdownRef.value = false;
381
378
searchDropdownOptions.value = [];
382
379
};
@@ -588,7 +585,7 @@ onMounted(() => {
588
585
};
589
586
590
587
const onUpAndDownKeysHandle = () => {
591
- if (showSearchDropdownRef.value) {
588
+ if (showSearchDropdownRef.value===true ) {
592
589
return;
593
590
}
594
591
isOnInputData = false;
@@ -611,23 +608,15 @@ onMounted(() => {
611
608
case '40':
612
609
case '\u001bOB':
613
610
case '\u001bOA':
614
- onUpAndDownKeysHandle() ;
611
+ isOnInputData = false ;
615
612
break;
616
613
default:
617
614
isOnInputData = true;
618
615
}
619
616
620
617
webSocket?.sendJsonMessage(new Msg(channelId, data, MessageType.CMD));
621
618
});
622
- watch(
623
- () => showSearchDropdownRef.value,
624
- () => {
625
- if (!showSearchDropdownRef.value) {
626
- isInMenuSelection = false;
627
- }
628
- },
629
- { immediate: true }
630
- );
619
+
631
620
632
621
term.attachCustomKeyEventHandler(e => {
633
622
const { keyCode, ctrlKey,shiftKey } = e;
@@ -655,11 +644,8 @@ onMounted(() => {
655
644
return true;
656
645
}
657
646
658
- if (moveKey.includes(keyCode) && showSearchDropdownRef.value) {
659
- isInMenuSelection = true;
660
- }
661
647
662
- if (isInMenuSelection && menuKeyCodes.includes(keyCode)) {
648
+ if (showSearchDropdownRef.value === true && menuKeyCodes.includes(keyCode)) {
663
649
if (keyCode === 27) {
664
650
showSearchDropdownRef.value = false;
665
651
}
0 commit comments