Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/6647

Vanessae8c202e27b3a
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 3fccdfff7a..7f9c521057 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -476,6 +476,15 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, focus: b
}
});
}
+ if (updateElements.length === 0) {
+ // 页签拖入浮窗 https://github.com/siyuan-note/siyuan/issues/6647
+ window.siyuan.blockPanels.forEach((item) => {
+ const updateCloneElement = item.element.querySelector(`[data-node-id="${operation.id}"]`)
+ if (updateCloneElement) {
+ updateElements.push(updateCloneElement.cloneNode(true) as Element);
+ }
+ });
+ }
/// #endif
let hasFind = false;
if (operation.previousID && updateElements.length > 0) {
@@ -525,7 +534,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, focus: b
}
// 更新 ws 嵌入块
protyle.wysiwyg.element.querySelectorAll('[data-type="NodeBlockQueryEmbed"]').forEach((item) => {
- if (item.querySelector(`[data-node-id="${operation.id}"]`)) {
+ if (item.querySelector(`[data-node-id="${operation.id}"],[data-node-id="${operation.parentID}"],[data-node-id="${operation.previousID}"]`)) {
item.removeAttribute("data-render");
blockRender(protyle, item);
}