Vanessa 2026-02-05 18:14:38 +08:00
parent 6207421d47
commit 5e15d73655

View file

@ -1,6 +1,6 @@
import {setEditMode} from "../util/setEditMode";
import {scrollEvent} from "../scroll/event";
import {isMobile} from "../../util/functions";
import {isMobile, isTouchDevice} from "../../util/functions";
import {Constants} from "../../constants";
import {isMac} from "../util/compatibility";
import {setInlineStyle} from "../../util/assets";
@ -184,7 +184,9 @@ export const initUI = (protyle: IProtyle) => {
});
});
let overAttr = false;
protyle.element.addEventListener("mouseover", (event: KeyboardEvent & { target: HTMLElement }) => {
protyle.element.addEventListener(isTouchDevice() ? "touchend" : "mouseover", (event: KeyboardEvent & {
target: HTMLElement
}) => {
// attr
const attrElement = hasClosestByClassName(event.target, "protyle-attr");
if (attrElement && !attrElement.parentElement.classList.contains("protyle-title")) {