Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9773

Vanessa6d72ce0e188f
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 7d257e61e6..0ea1d59e70 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -414,6 +414,9 @@ export const showKeyboardToolbar = () => {
if (editor && editor.protyle.wysiwyg.element.contains(range.startContainer)) {
editor.protyle.element.parentElement.style.paddingBottom = "42px";
}
+ getCurrentEditor().protyle.app.plugins.forEach(item => {
+ item.eventBus.emit("mobile-keyboard-show");
+ });
setTimeout(() => {
const contentElement = hasClosestByClassName(range.startContainer, "protyle-content", true);
if (contentElement) {
@@ -435,6 +438,9 @@ export const hideKeyboardToolbar = () => {
return;
}
const toolbarElement = document.getElementById("keyboardToolbar");
+ if (toolbarElement.classList.contains("fn__none")) {
+ return;
+ }
toolbarElement.classList.add("fn__none");
toolbarElement.style.height = "";
const editor = getCurrentEditor();
@@ -445,6 +451,9 @@ export const hideKeyboardToolbar = () => {
if (modelElement.style.transform === "translateY(0px)") {
modelElement.style.paddingBottom = "";
}
+ getCurrentEditor().protyle.app.plugins.forEach(item => {
+ item.eventBus.emit("mobile-keyboard-hide");
+ });
};
export const activeBlur = () => {
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 0b55f862c0..de0c8fa9a0 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -60,7 +60,8 @@ type TEventBus = "ws-main" |
"input-search" |
"loaded-protyle" | "loaded-protyle-dynamic" | "loaded-protyle-static" |
"switch-protyle" |
- "destroy-protyle"
+ "destroy-protyle" |
+ "mobile-keyboard-show" | "mobile-keyboard-hide"
type TAVCol =
"text"
| "date"