Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve soft keyboard toolbar pop-up https://github.com/siyuan-note/siyuan/issues/16548

Danielde1a209e585b
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 88c5371d1d..97a4c4486f 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -415,11 +415,11 @@ const renderKeyboardToolbar = () => {
};
export const showKeyboardToolbar = () => {
- if (!showUtil || getSelection().rangeCount === 0) {
+ if (!showUtil) {
hideKeyboardToolbarUtil();
}
const toolbarElement = document.getElementById("keyboardToolbar");
- if (!toolbarElement.classList.contains("fn__none")) {
+ if (!toolbarElement.classList.contains("fn__none") || getSelection().rangeCount === 0) {
return;
}
toolbarElement.classList.remove("fn__none");
diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts
index 8a9ebbb7cc..3fea1d1228 100644
--- a/app/src/mobile/util/touch.ts
+++ b/app/src/mobile/util/touch.ts
@@ -31,7 +31,7 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
const wysisygElement = hasClosestByClassName(target, "protyle-wysiwyg", true);
if (!yDiff || Math.abs(yDiff) < 10) {
let editElement: HTMLElement;
- if (["INPUT", "TEXTAREA"].includes(target.tagName) && target.getAttribute("readonly") !== "true") {
+ if (["INPUT", "TEXTAREA"].includes(target.tagName) && target.getAttribute("readonly") !== "readonly") {
editElement = target;
} else if (wysisygElement && wysisygElement.getAttribute("data-readonly") === "false") {
editElement = hasClosestByAttribute(target, "contenteditable", "true") as HTMLElement;