From d85ede2b4871a77d2ae68e628b133bd39e5d97d6 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 26 Sep 2022 21:36:15 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5972 --- app/src/block/Panel.ts | 3 +-- app/src/protyle/toolbar/index.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/block/Panel.ts b/app/src/block/Panel.ts index 66b00608c..643b55a54 100644 --- a/app/src/block/Panel.ts +++ b/app/src/block/Panel.ts @@ -61,7 +61,6 @@ export class BlockPanel { if (this.element && window.siyuan.blockPanels.length > 1) { this.element.classList.add("block__popover--top"); } - let targetElement = hasClosestByClassName(event.target, "block__icons"); let type = "move"; let x = event.clientX - parseInt(this.element.style.left); @@ -190,7 +189,7 @@ export class BlockPanel { const index = parseInt(editorElement.getAttribute("data-index")); const editor = new Protyle(editorElement, { blockId: this.nodeIds[index], - defId: this.defIds[index] ||this.defIds[0] || "", + defId: this.defIds[index] || this.defIds[0] || "", action: [Constants.CB_GET_ALL], render: { gutter: true, diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 890ae46cc..4f3785d43 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -840,6 +840,7 @@ export class Toolbar { if (hasClosestByClassName(event.target as HTMLElement, "block__icon")) { return; } + event.stopPropagation(); const documentSelf = document; this.subElement.style.userSelect = "none"; const x = event.clientX - parseInt(this.subElement.style.left);