From 75f85ec18aefc259caa75526fd391cbe4a758643 Mon Sep 17 00:00:00 2001 From: MJZDMJ <1798658427@qq.com> Date: Mon, 1 Sep 2025 10:55:45 +0000 Subject: [PATCH] update ArkUI/entry/src/main/ets/pages/ClickButtonSoftwareKeyboardToClose.ets. Signed-off-by: MJZDMJ <1798658427@qq.com> --- .../main/ets/pages/ClickButtonSoftwareKeyboardToClose.ets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ArkUI/entry/src/main/ets/pages/ClickButtonSoftwareKeyboardToClose.ets b/ArkUI/entry/src/main/ets/pages/ClickButtonSoftwareKeyboardToClose.ets index 186031a..05f7d36 100644 --- a/ArkUI/entry/src/main/ets/pages/ClickButtonSoftwareKeyboardToClose.ets +++ b/ArkUI/entry/src/main/ets/pages/ClickButtonSoftwareKeyboardToClose.ets @@ -32,7 +32,11 @@ struct ClickBlankHideKeyboard { Button('log on').width('100%') .onClick(() => { // Exit text editing mode - inputMethod.getController().stopInputSession(); + try { + inputMethod.getController().stopInputSession(); + } catch (err) { + console.error('Failed to hide keyboard: ' + err); + } }) } } -- Gitee