Skip to content

Commit 5cfd38d

Browse files
committed
🎨 Improve block icons display
fix #12316
1 parent a06da15 commit 5cfd38d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/boot/globalEvent/mousemove.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import {getColIndex} from "../../protyle/util/table";
66
const getRightBlock = (element: HTMLElement, x: number, y: number) => {
77
let index = 1;
88
let nodeElement = element;
9+
if (nodeElement && nodeElement.classList.contains("protyle-action")) {
10+
nodeElement = nodeElement.parentElement;
11+
}
912
while (nodeElement && (nodeElement.classList.contains("list") || nodeElement.classList.contains("li"))) {
1013
nodeElement = document.elementFromPoint(x + 73 * index, y) as HTMLElement;
1114
nodeElement = hasClosestBlock(nodeElement) as HTMLElement;
@@ -145,7 +148,7 @@ export const windowMouseMove = (event: MouseEvent, mouseIsEnter: boolean) => {
145148
}
146149
return;
147150
}
148-
if (eventPath0 && eventPath0.nodeType !== 3 && (eventPath0.classList.contains("li") || eventPath0.classList.contains("list"))) {
151+
if (eventPath0 && eventPath0.nodeType !== 3 && (eventPath0.classList.contains("li") || eventPath0.classList.contains("list") || eventPath0.classList.contains("protyle-action"))) {
149152
// 光标在列表下部应显示右侧的元素,而不是列表本身
150153
const targetBlockElement = getRightBlock(eventPath0, eventPath0.getBoundingClientRect().left + 1, event.clientY);
151154
if (!targetBlockElement) {

0 commit comments

Comments
 (0)