mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-10-23 20:51:18 +08:00
fix: 键盘事件触发也会focus 搜索框聚焦统一调用window.focus方法
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="clip-search">
|
||||
<input v-model="filterText" autofocus type="text" placeholder="🔍 检索剪贴板历史" />
|
||||
<input v-model="filterText" type="text" placeholder="🔍 检索剪贴板历史" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@@ -143,9 +143,11 @@ onMounted(() => {
|
||||
const target = index === list.length - 1 ? list[0] : list[index + 1]
|
||||
updateShowList(target)
|
||||
} else if (isSearch) {
|
||||
document.querySelector('input').focus()
|
||||
window.focus()
|
||||
} else if (isExit) {
|
||||
filterText.value = ''
|
||||
} else {
|
||||
window.focus() // 其他键盘事件 直接聚焦搜索框
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user