fix: 修复了非预期的搜索框聚焦行为 #33

This commit is contained in:
ZiuChen 2022-09-06 22:31:17 +08:00
parent 8daf1edba0
commit 1820c4187f

View File

@ -143,6 +143,8 @@ onMounted(() => {
const isSearch =
(ctrlKey && (key === 'F' || key === 'f')) || (ctrlKey && (key === 'L' || key === 'l'))
const isExit = key === 'Escape'
const isArrow = key === 'ArrowDown' || key === 'ArrowUp'
const isEnter = key === 'Enter'
if (isTab) {
const tabTypes = tabs.map((item) => item.type)
const index = tabTypes.indexOf(activeTab.value)
@ -156,9 +158,8 @@ onMounted(() => {
filterText.value = ''
e.stopPropagation()
}
} else if (ctrlKey || metaKey) {
// Ctrl
// utools
} else if (ctrlKey || metaKey || isArrow || isEnter) {
// Ctrl (utools)
} else {
window.focus() //
}