mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
This commit is contained in:
@@ -53,10 +53,6 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
||||
const assetsElement = element.querySelector("#searchAssets");
|
||||
const isAsset = !assetsElement.classList.contains("fn__none");
|
||||
const listElement = isAsset ? assetsElement.querySelector("#searchAssetList") : element.querySelector("#searchList");
|
||||
let currentList: HTMLElement = listElement.querySelector(".b3-list-item--focus");
|
||||
if (!currentList) {
|
||||
return false;
|
||||
}
|
||||
const searchInputElement = element.querySelector("#searchInput") as HTMLInputElement;
|
||||
if (!isAsset && matchHotKey(window.siyuan.config.keymap.general.newFile.custom, event)) {
|
||||
newFileByName(app, searchInputElement.value);
|
||||
@@ -80,6 +76,10 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
||||
// 不能返回 true,否则历史菜单无法使用快捷键
|
||||
return false;
|
||||
}
|
||||
let currentList: HTMLElement = listElement.querySelector(".b3-list-item--focus");
|
||||
if (!currentList) {
|
||||
return false;
|
||||
}
|
||||
if (currentList.getAttribute("data-type") === "search-new") {
|
||||
if (event.key === "Enter") {
|
||||
newFileByName(app, searchInputElement.value);
|
||||
|
||||
Reference in New Issue
Block a user