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/18136

Vanessa353b9236fb6a
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 01c4f41f64..28b32d0121 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1210,6 +1210,7 @@ export class WYSIWYG {
documentSelf.onselectstart = null;
documentSelf.onselect = null;
if (target.classList.contains("protyle-action__drag") && nodeElement) {
+ focusBlock(nodeElement);
updateTransaction(protyle, nodeElement, html);
}
nodeElement.classList.remove("iframe--drag");
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 6d264671fa..264d4159e2 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -112,6 +112,7 @@ const promiseTransaction = (options: {
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach((item) => {
if (range && (item === range.startContainer || item.contains(range.startContainer))) {
// 正在编辑的块不能进行更新
+ item.removeAttribute(Constants.ATTRIBUTE_EDITING);
} else {
updateHTML(item, operation.data);
}
@@ -119,11 +120,14 @@ const promiseTransaction = (options: {
protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg__embed").forEach(item => {
if (range && (item === range.startContainer || item.contains(range.startContainer))) {
// 正在编辑的块不能进行更新
+ item.removeAttribute(Constants.ATTRIBUTE_EDITING);
} else {
// https://github.com/siyuan-note/siyuan/issues/14495
const newTempElement = allTempElement.content.querySelector(`[data-node-id="${item.getAttribute("data-id")}"]`);
if (newTempElement && !isInEmbedBlock(newTempElement)) {
updateHTML(item.querySelector("[data-node-id]"), newTempElement.outerHTML);
+ } else {
+ item.removeAttribute(Constants.ATTRIBUTE_EDITING);
}
}
});