fix: 键盘事件触发也会focus 搜索框聚焦统一调用window.focus方法

This commit is contained in:
ZiuChen
2022-08-16 11:57:51 +08:00
parent c1aac6553e
commit f110bc5dda
3 changed files with 9 additions and 2 deletions

View File

@@ -176,6 +176,8 @@ const paste = () => {
}
}
const focus = () => document.querySelector('.clip-search input')?.focus()
const db = new DB(DBPath)
db.init()
@@ -192,8 +194,11 @@ watchClipboard(db, (item) => {
db.addItem(item)
})
utools.onPluginEnter(() => focus())
window.db = db
window.copy = copy
window.paste = paste
window.openFile = utools.shellOpenPath
window.getIcon = utools.getFileIcon
window.focus = focus