From 84b42d447a656d71e5589aaa4133bd2c52dca3a0 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 21 Jun 2024 23:44:40 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/11769 --- app/src/block/popover.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts index d667b7ff8..da21bf9b4 100644 --- a/app/src/block/popover.ts +++ b/app/src/block/popover.ts @@ -6,6 +6,7 @@ import {getIdFromSYProtocol, isLocalPath} from "../util/pathName"; import {App} from "../index"; import {Constants} from "../constants"; import {getCellText} from "../protyle/render/av/cell"; +import {isTouchDevice} from "../util/functions"; let popoverTargetElement: HTMLElement; export const initBlockPopover = (app: App) => { @@ -138,7 +139,7 @@ export const initBlockPopover = (app: App) => { const hidePopover = (event: MouseEvent & { path: HTMLElement[] }) => { // pad 端点击后 event.target 不会更新。 - const target = document.elementFromPoint(event.clientX, event.clientY); + const target = isTouchDevice() ? document.elementFromPoint(event.clientX, event.clientY) : event.target as HTMLElement if (!target) { return false; }