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 df567109745d0c2624d6c72283b277c67e13547c..1f3c735b0ef795858c91cc0ecf71c058ff421124 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 5f3a67c3628f4209dce770b382a28fc442b66431..50be54c4b0ad32053498917760e5b350a72c2bf7 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) => {