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 f29018808a58be674da97260e25aa302902c6dcb..9efe31f6ca5e77bfc6a838b49abab3222faf117e 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;