From 6255de2034e89a6a5e4c400d12afc6260e7da4c1 Mon Sep 17 00:00:00 2001 From: hxy-111 <976125628@qq.com> Date: Fri, 8 Dec 2023 11:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E5=AD=97=E9=94=AE?= =?UTF-8?q?=E7=9B=98=E6=97=A0=E6=B3=95=E8=BF=9E=E7=BB=AD=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/plugin/editing/TextInputPlugin.ets | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets index f29018808a..9efe31f6ca 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets @@ -66,7 +66,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { mEditable: ListenableEditingState; private mRestartInputPending: boolean = false; private plugin: EditingStateWatcher | ESObject; - + private keyboardStatus: inputMethod.KeyboardStatus = KeyboardStatus.NONE; private imcFlag: boolean = false; constructor(plugin: TextInputPlugin | ESObject) { @@ -82,11 +82,16 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } show(): void { + if(this.keyboardStatus == KeyboardStatus.SHOW){ + return; + } this.showTextInput(); + this.keyboardStatus = KeyboardStatus.SHOW; } hide(): void { this.hideTextInput(); + this.keyboardStatus = KeyboardStatus.HIDE; } requestAutofill(): void { @@ -253,6 +258,13 @@ enum Type { PHYSICAL_DISPLAY_PLATFORM_VIEW, } +enum KeyboardStatus { + NONE = 0, + HIDE = 1, + SHOW = 2, +} + + export class InputTarget { type: Type; id: number; -- Gitee