Skip to content

Commit 68cf4c6

Browse files
authored
🎨 When a window is inactive, pressing Shift and clicking the block icon fails to open the attribute panel (#16142)
fix #15075
1 parent 067db07 commit 68cf4c6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/src/protyle/breadcrumb/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ ${padHTML}
8888
event.stopPropagation();
8989
break;
9090
} else if (type === "doc") {
91-
if (window.siyuan.shiftIsPressed) {
91+
// 不使用 window.siyuan.shiftIsPressed ,否则窗口未激活时按 Shift 点击块标无法打开属性面板 https://github.com/siyuan-note/siyuan/issues/15075
92+
if (event.shiftKey) {
9293
fetchPost("/api/block/getDocInfo", {
9394
id: protyle.block.rootID
9495
}, (response) => {

app/src/protyle/gutter/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ export class Gutter {
404404
}
405405
}
406406
foldElement.classList.remove("protyle-wysiwyg--hl");
407-
} else if (window.siyuan.shiftIsPressed && !protyle.disabled) {
407+
} else if (event.shiftKey && !protyle.disabled) {
408+
// 不使用 window.siyuan.shiftIsPressed ,否则窗口未激活时按 Shift 点击块标无法打开属性面板 https://github.com/siyuan-note/siyuan/issues/15075
408409
openAttr(protyle.wysiwyg.element.querySelector(`[data-node-id="${id}"]`), "bookmark", protyle);
409410
} else if (!window.siyuan.ctrlIsPressed && !window.siyuan.altIsPressed && !window.siyuan.shiftIsPressed) {
410411
this.renderMenu(protyle, buttonElement);

0 commit comments

Comments
 (0)