Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/17633

Vanessa5d77736abb7a
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 9c713b9299..44fb52505f 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -106,7 +106,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.stopPropagation();
return;
}
- if (protyle.disabled || !protyle.selectElement.classList.contains("fn__none")) {
+ if (protyle.disabled ||
+ (!protyle.selectElement.classList.contains("fn__none") && protyle.selectElement.style.backgroundColor === "")) {
event.stopPropagation();
event.preventDefault();
return;
@@ -2036,7 +2037,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
}
const nodeEditableElement = getContenteditableElement(nodeElement);
const position = getSelectionOffset(nodeEditableElement, protyle.wysiwyg.element, range);
- if (position.start === 0 && range.startOffset === 0 && event.key === "ArrowLeft" && !isIncludesHotKey("⌥⇧←")) {
+ if (position.start === 0 && range.startOffset === 0 && event.key === "ArrowLeft" && !isIncludesHotKey("⌥⇧←")) {
event.preventDefault();
event.stopPropagation();
return;