From d4ef7a6c2968550bfef40ecccedd3dc83600ac18 Mon Sep 17 00:00:00 2001 From: laoguanyao <806103474@qq.com> Date: Mon, 16 Dec 2024 19:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95=E5=90=88?= =?UTF-8?q?=E7=90=86=E6=80=A7=EF=BC=8C=E5=88=A0=E9=99=A4=E6=98=93=E5=87=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laoguanyao <806103474@qq.com> --- .../ets/embedding/ohos/FlutterAbilityAndEntryDelegate.ets | 4 +--- .../flutter/src/main/ets/plugin/editing/TextInputPlugin.ets | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterAbilityAndEntryDelegate.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterAbilityAndEntryDelegate.ets index df56710974..1f3c735b0e 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterAbilityAndEntryDelegate.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterAbilityAndEntryDelegate.ets @@ -35,7 +35,6 @@ import FlutterNapi from '../engine/FlutterNapi'; import { FlutterView } from '../../view/FlutterView'; import FlutterManager from './FlutterManager'; import Any from '../../plugin/common/Any'; -import inputMethod from '@ohos.inputMethod'; const TAG = "FlutterAbilityDelegate"; const PLUGINS_RESTORATION_BUNDLE_KEY = "plugins"; @@ -56,7 +55,6 @@ class FlutterAbilityAndEntryDelegate implements ExclusiveAppComponent private engineGroup?: FlutterEngineGroup; private isHost:boolean = false; private flutterView?: FlutterView; - private inputMethodController: inputMethod.InputMethodController = inputMethod.getController(); constructor(host?: Host) { this.host = host; @@ -99,7 +97,7 @@ class FlutterAbilityAndEntryDelegate implements ExclusiveAppComponent this.flutterEngine?.getNavigationChannel()?.popRoute(); this.flutterEngine?.getPlatformViewsController()?.setBackNodeControllers(); } else { - this.inputMethodController.detach(); + this.flutterEngine?.getTextInputChannel()?.textInputMethodHandler?.hide(); } }); } 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 5f3a67c362..50be54c4b0 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 @@ -324,9 +324,6 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { private sendKeyboardStatusCallback = (state: inputMethod.KeyboardStatus) => { this.keyboardStatus = state; - if (state == inputMethod.KeyboardStatus.HIDE) { - this.plugin.textInputChannel.onConnectionClosed(this.inputTarget.id); - } } private selectByRangeCallback = (range: inputMethod.Range) => { -- Gitee