Skip to content

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

:bug: Ensure mobile search opens the keyboard https://github.com/siyuan-note/siyuan/issues/18971

Danielf63e35a26fd5
diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.ts
index 7b082d913e..e181999f53 100644
--- a/app/src/mobile/menu/search.ts
+++ b/app/src/mobile/menu/search.ts
@@ -14,6 +14,7 @@ import {newFile} from "../../util/newFile";
import {showMessage} from "../../dialog/message";
import {reloadProtyle} from "../../protyle/util/reload";
import {activeBlur} from "../util/keyboardToolbar";
+import {callMobileAppShowKeyboard} from "../util/mobileAppUtil";
import type {App} from "../../index";
import {
assetFilterMenu,
@@ -384,7 +385,12 @@ const initSearchEvent = (app: App, element: Element, config: Config.IUILayoutTab
updateSearchResult(config, element, true);
}
});
- searchInputElement.focus();
+ if (window.JSAndroid?.showKeyboard || window.JSHarmony?.showKeyboard) {
+ callMobileAppShowKeyboard();
+ setTimeout(() => searchInputElement.focus(), Constants.TIMEOUT_TRANSITION);
+ } else {
+ searchInputElement.focus();
+ }
const replaceInputElement = element.querySelector(".toolbar .toolbar__title") as HTMLInputElement;
replaceInputElement.value = config.r || "";
addClearButton({