diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/TextInputChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/TextInputChannel.ets index b077d6b0fab48e669ec59857cce297d7d6f1ab16..801e8ecdd478c0fe0bd8438de31b90539e2f37dd 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/TextInputChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/TextInputChannel.ets @@ -20,7 +20,6 @@ import TextInputPlugin from '../../../plugin/editing/TextInputPlugin'; import Log from '../../../util/Log'; import DartExecutor from '../dart/DartExecutor'; import inputMethod from '@ohos.inputMethod'; -import { DEFAULT } from '@ohos/hypium'; const TAG = "TextInputChannel"; diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/ListenableEditingState.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/ListenableEditingState.ets index 6396d2520ea410535ef7d638b8868146c7344d18..bb7bec773d1bf039f1c390fd191af245e8b6f4f9 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/ListenableEditingState.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/ListenableEditingState.ets @@ -252,7 +252,6 @@ export class ListenableEditingState { this.TextInputChannel.unspecifiedAction(this.client); break; case inputMethod.EnterKeyType.NONE: - this.TextInputChannel.done(this.client) break; case inputMethod.EnterKeyType.GO: this.TextInputChannel.go(this.client); 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 9efe31f6ca5e77bfc6a838b49abab3222faf117e..56fe4ed5935cd11d36b8ec25046beea97876d848 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 @@ -154,7 +154,16 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } setTextInputClient(client: number, configuration: Configuration | null): void { - this.configuration = configuration; + const INPUT_TYPE_NAME = ['NONE', 'TEXT', 'MULTILINE', 'NUMBER', 'PHONE','DATETIME','EMAIL_ADDRESS','URL','VISIBLE_PASSWORD'] + if(configuration) + { + this.configuration = configuration; + if(configuration.inputType) + { + this.textConfig.inputAttribute.textInputType =INPUT_TYPE_NAME.indexOf(configuration.inputType.type) + this.textConfig.inputAttribute.enterKeyType = configuration.inputAction as ESObject; + } + } if(this.canShowTextInput()) { this.inputTarget = new InputTarget(Type.FRAMEWORK_CLIENT, client); } else {