🎨 The keyboard pops up and then automatically retracts on some HarmonyOS devices https://github.com/siyuan-note/siyuan/issues/17100

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel
2026-02-25 17:51:52 +08:00
parent c2895ac69f
commit 0d6c17cfcf

View File

@@ -4,8 +4,8 @@ export let keyboardLockUntil = 0;
export const callMobileAppShowKeyboard = () => {
// 某些机型(比如鸿蒙 Pura X在弹起键盘后会立即触发 activeBlur 导致键盘被关闭,所以在主动唤起键盘时锁定一段时间,禁止 activeBlur 关闭键盘
// 每次主动唤起键盘时,锁定接下来的 200ms 不允许通过 activeBlur 关闭
keyboardLockUntil = Date.now() + 200;
// 每次主动唤起键盘时,锁定接下来的 500ms 不允许通过 activeBlur 关闭
keyboardLockUntil = Date.now() + 500;
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
window.JSAndroid.showKeyboard();