From c9a9539e8b3ec68fb1de741c25587880e4d43834 Mon Sep 17 00:00:00 2001 From: lwtt <1377477209@qq.com> Date: Tue, 19 Dec 2023 20:22:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEinputType=E5=92=8CenterAction=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lwtt <1377477209@qq.com> --- .../engine/systemchannels/TextInputChannel.ets | 1 - .../main/ets/plugin/editing/ListenableEditingState.ets | 1 - .../src/main/ets/plugin/editing/TextInputPlugin.ets | 10 ++++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) 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 b077d6b0fa..801e8ecdd4 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 6396d2520e..bb7bec773d 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 9efe31f6ca..7079cfeade 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,6 +154,16 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } setTextInputClient(client: number, configuration: Configuration | null): void { + 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; + } + } this.configuration = configuration; if(this.canShowTextInput()) { this.inputTarget = new InputTarget(Type.FRAMEWORK_CLIENT, client); -- Gitee From 306aba6c3216f6ee706196c4db9291340a68b5d9 Mon Sep 17 00:00:00 2001 From: lwtt <1377477209@qq.com> Date: Tue, 19 Dec 2023 20:26:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lwtt <1377477209@qq.com> --- .../flutter/src/main/ets/plugin/editing/TextInputPlugin.ets | 1 - 1 file changed, 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 7079cfeade..56fe4ed593 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 @@ -164,7 +164,6 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.textConfig.inputAttribute.enterKeyType = configuration.inputAction as ESObject; } } - this.configuration = configuration; if(this.canShowTextInput()) { this.inputTarget = new InputTarget(Type.FRAMEWORK_CLIENT, client); } else { -- Gitee