Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:children_crossing: fix https://github.com/siyuan-note/siyuan/issues/5923

Vanessa407b3b00400a
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 6a419feb17..7d2c73d67b 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -234,7 +234,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
hideElements(["select"], protyle);
return false;
}
- if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event)) {
+ if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event) && !event.repeat) {
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
if (selectElements.length > 0) {
setFold(protyle, selectElements[0]);
@@ -255,7 +255,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.preventDefault();
return false;
}
- if (matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event)) {
+
+ if (matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event) && !event.repeat) {
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
if (selectElements.length > 0) {
setFold(protyle, selectElements[0], true);
diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts
index c7e59d01c4..aea5f4a090 100644
--- a/app/src/util/globalShortcut.ts
+++ b/app/src/util/globalShortcut.ts
@@ -536,7 +536,7 @@ export const globalShortcut = () => {
}
// 面板折叠展开操作
- if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event) || matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event)) {
+ if (!event.repeat && (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event) || matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event))) {
let activePanelElement = document.querySelector(".block__icons--active");
if (!activePanelElement) {
Array.from(document.querySelectorAll(".layout__wnd--active .layout-tab-container > div")).forEach(item => {