From 7a3a0fbdcb2543fbf4e24c46e67823c4092211b7 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 8 Jun 2025 11:27:23 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/pull/14832 --- app/src/boot/globalEvent/mousemove.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/boot/globalEvent/mousemove.ts b/app/src/boot/globalEvent/mousemove.ts index 63c17ba6c..7d243de60 100644 --- a/app/src/boot/globalEvent/mousemove.ts +++ b/app/src/boot/globalEvent/mousemove.ts @@ -7,7 +7,7 @@ const getRightBlock = (element: HTMLElement, x: number, y: number) => { let index = 1; let nodeElement = element; if (nodeElement && nodeElement.classList.contains("protyle-action")) { - nodeElement = nodeElement.parentElement; + return nodeElement.parentElement; } while (nodeElement && (nodeElement.classList.contains("list") || nodeElement.classList.contains("li"))) { nodeElement = document.elementFromPoint(x + 73 * index, y) as HTMLElement; @@ -148,7 +148,11 @@ export const windowMouseMove = (event: MouseEvent, mouseIsEnter: boolean) => { } return; } - if (eventPath0 && eventPath0.nodeType !== 3 && (eventPath0.classList.contains("li") || eventPath0.classList.contains("list") || eventPath0.classList.contains("protyle-action"))) { + if (eventPath0 && eventPath0.nodeType !== 3 && ( + eventPath0.classList.contains("li") || + eventPath0.classList.contains("list") || + eventPath0.classList.contains("protyle-action") + )) { // 光标在列表下部应显示右侧的元素,而不是列表本身 const targetBlockElement = getRightBlock(eventPath0, eventPath0.getBoundingClientRect().left + 1, event.clientY); if (!targetBlockElement) {