|
@@ -323,7 +323,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|
|
return true;
|
|
|
}
|
|
|
const target = event.target as HTMLElement;
|
|
|
- if (target.tagName !== "TABLE" && (target.tagName === "INPUT" || target.tagName === "TEXTAREA")) {
|
|
|
+ if (target.tagName !== "TABLE" && ["INPUT", "TEXTAREA"].includes(target.tagName)) {
|
|
|
return false;
|
|
|
}
|
|
|
if (matchHotKey(window.siyuan.config.keymap.editor.general.backlinks.custom, event)) {
|
|
@@ -653,7 +653,7 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|
|
return true;
|
|
|
}
|
|
|
const target = event.target as HTMLElement;
|
|
|
- if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" ||
|
|
|
+ if (["INPUT", "TEXTAREA"].includes(target.tagName) ||
|
|
|
hasClosestByAttribute(target, "contenteditable", null) ||
|
|
|
hasClosestByClassName(target, "protyle", true)) {
|
|
|
return false;
|
|
@@ -834,7 +834,7 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|
|
const panelTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|
|
// 面板折叠展开操作
|
|
|
const target = event.target as HTMLElement;
|
|
|
- if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" ||
|
|
|
+ if (["INPUT", "TEXTAREA"].includes(target.tagName) ||
|
|
|
hasClosestByAttribute(target, "contenteditable", null) ||
|
|
|
hasClosestByClassName(target, "protyle", true)) {
|
|
|
return false;
|
|
@@ -1280,7 +1280,7 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
|
|
event.preventDefault();
|
|
|
return;
|
|
|
}
|
|
|
- if (matchHotKey("⌘A", event) && target.tagName !== "INPUT" && target.tagName !== "TEXTAREA") {
|
|
|
+ if (matchHotKey("⌘A", event) && !["INPUT", "TEXTAREA"].includes(target.tagName)) {
|
|
|
event.preventDefault();
|
|
|
return;
|
|
|
}
|