From 93ceb872ce567406ea0cf5c27c533c4cfbc046fa Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 29 May 2025 21:49:32 +0800 Subject: [PATCH] :bug: Unable to set inline element on HarmonyOS https://github.com/siyuan-note/siyuan/issues/14687 --- app/src/mobile/util/keyboardToolbar.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts index 9690f6316..5424d0d10 100644 --- a/app/src/mobile/util/keyboardToolbar.ts +++ b/app/src/mobile/util/keyboardToolbar.ts @@ -2,7 +2,8 @@ import {listIndent, listOutdent} from "../../protyle/wysiwyg/list"; import { hasClosestBlock, hasClosestByAttribute, - hasClosestByClassName, hasClosestByTag, + hasClosestByClassName, + hasClosestByTag, } from "../../protyle/util/hasClosest"; import {moveToDown, moveToUp} from "../../protyle/wysiwyg/move"; import {Constants} from "../../constants"; @@ -11,7 +12,7 @@ import {getCurrentEditor} from "../editor"; import {fontEvent, getFontNodeElements} from "../../protyle/toolbar/Font"; import {hideElements} from "../../protyle/ui/hideElements"; import {softEnter} from "../../protyle/wysiwyg/enter"; -import {isInAndroid} from "../../protyle/util/compatibility"; +import {isInAndroid, isInHarmony} from "../../protyle/util/compatibility"; let renderKeyboardToolbarTimeout: number; let showUtil = false; @@ -519,7 +520,7 @@ export const initKeyboardToolbar = () => {
`; - toolbarElement.addEventListener(isInAndroid() ? "touchstart" : "click", (event) => { + toolbarElement.addEventListener(isInAndroid() || isInHarmony() ? "touchstart" : "click", (event) => { const protyle = getCurrentEditor()?.protyle; const target = event.target as HTMLElement; const slashBtnElement = hasClosestByClassName(event.target as HTMLElement, "keyboard__slash-item");