Skip to content

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

:bug: Preserve input focus when switching secure keyboards https://github.com/siyuan-note/siyuan/issues/19362

Danielca05f09109f4
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 80e3fd5579..e4cb0acefd 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -1171,6 +1171,12 @@ export const hideKeyboardToolbar = () => {
export const hideKeyboardToolbarByApp = (preserveSelection = false) => {
inlineMathSelection.reset();
+ if (preserveSelection && ["INPUT", "TEXTAREA"].includes(document.activeElement?.tagName)) {
+ // 输入法切换安全键盘时会临时隐藏,保留普通输入框焦点,避免中断密码输入。
+ preventKeyboardToolbarRender();
+ hideKeyboardToolbar();
+ return KeyboardHideResult.PreserveSelection;
+ }
const tableCellSelectionRestored = preserveSelection && restoreRecentAndroidTableCellSelectAll();
if (tableCellSelectionRestored) {
return KeyboardHideResult.RestoreTableCellSelection;