Skip to content

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

:lipstick: fix https://github.com/siyuan-note/siyuan/issues/5499

Vanessab75be56ac0f8
diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts
index 207bbfafd7..bd446ef75a 100644
--- a/app/src/asset/anno.ts
+++ b/app/src/asset/anno.ts
@@ -267,9 +267,9 @@ let rectElement: HTMLElement;
const showToolbar = (element: HTMLElement, range: Range, target?: HTMLElement) => {
if (target) {
// 阻止 popover
- target.classList.remove("popover__block");
+ target.setAttribute("prevent-popover", "true");
setTimeout(() => {
- target.classList.add("popover__block");
+ target.removeAttribute("prevent-popover");
}, 620);
}
diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts
index beda414d06..c441215403 100644
--- a/app/src/block/popover.ts
+++ b/app/src/block/popover.ts
@@ -106,7 +106,8 @@ export const initBlockPopover = () => {
if (!popoverTargetElement && aElement && aElement.getAttribute("data-href")?.startsWith("siyuan://blocks") && aElement.getAttribute("prevent-popover") !== "true") {
popoverTargetElement = aElement;
}
- if (!popoverTargetElement || window.siyuan.altIsPressed || window.siyuan.shiftIsPressed || window.siyuan.ctrlIsPressed) {
+ if (!popoverTargetElement || window.siyuan.altIsPressed || window.siyuan.shiftIsPressed || window.siyuan.ctrlIsPressed ||
+ (popoverTargetElement && popoverTargetElement.getAttribute("prevent-popover") === "true")) {
return;
}
// https://github.com/siyuan-note/siyuan/issues/4314
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index c975e4c8dc..99fce3299d 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -452,9 +452,9 @@ export class WYSIWYG {
const rect = target.getBoundingClientRect();
setPosition(window.siyuan.menus.menu.element, rect.left, rect.top + 13, 26);
// 阻止 popover
- target.removeAttribute("data-type");
+ target.setAttribute("prevent-popover", "true");
setTimeout(() => {
- target.setAttribute("data-type", "block-ref");
+ target.removeAttribute("prevent-popover");
}, 620);
return false;
}