fix: 优化按下ESC键搜索框的表现逻辑

This commit is contained in:
ZiuChen
2022-09-08 20:25:43 +08:00
parent eaa0e762c0
commit 9b172f684c

View File

@@ -184,11 +184,15 @@ onMounted(() => {
if (filterText.value) {
// 有筛选词 先清空筛选词
filterText.value = ''
} else {
// 无筛选词 隐藏搜索框
window.focus(true)
}
window.focus()
e.stopPropagation()
} else if (isSearchPanelExpand.value) {
// 移除焦点 隐藏搜索框
window.focus(true)
e.stopPropagation()
} else {
// 无上述情况 执行默认: 隐藏uTools主窗口
}
} else if (ctrlKey || metaKey || isArrow || isEnter) {
// 仅有 Ctrl时 什么也不执行 (utools模拟执行粘贴时触发)
e.preventDefault()