From c88213f835c53adafcb6abc545e8a3d02f78bdb3 Mon Sep 17 00:00:00 2001 From: harmonycommando <14755694+harmonycommando@user.noreply.gitee.com> Date: Mon, 18 Nov 2024 02:02:36 +0800 Subject: [PATCH] Revert "feat: synchronize unfocused behavior hiding softkeyboard with harmony native #IAXDXB" This reverts commit e6493a095b8795c98141891f64c690c184bf39b0. --- packages/flutter/lib/src/services/text_input.dart | 7 ------- packages/flutter/lib/src/widgets/editable_text.dart | 5 ----- 2 files changed, 12 deletions(-) diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index 38ae621ec7b..d133d6857a3 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -412,12 +412,6 @@ enum TextInputAction { /// Thus, [TextInputAction.newline] is a convenience term that alleviates the /// need to understand the underlying platforms to achieve this common behavior. newline, - /// Logical meaning: Remove focus of a textinput, - /// - /// OHOS: Only works for OHOS to remove focus of textinput hiding soft keyboard. - /// - /// Android & iOS: Not work for these two platforms. - removeFocus, } /// Configures how the platform keyboard will select an uppercase or @@ -1546,7 +1540,6 @@ TextInputAction _toTextInputAction(String action) { 'TextInputAction.emergencyCall' => TextInputAction.emergencyCall, 'TextInputAction.done' => TextInputAction.done, 'TextInputAction.newline' => TextInputAction.newline, - 'TextInputAction.removeFocus' => TextInputAction.removeFocus, _ => throw FlutterError.fromParts([ErrorSummary('Unknown text input action: $action')]), }; } diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart index d1c04dcae6b..6d2e749c97e 100644 --- a/packages/flutter/lib/src/widgets/editable_text.dart +++ b/packages/flutter/lib/src/widgets/editable_text.dart @@ -3282,10 +3282,6 @@ class EditableTextState extends State with AutomaticKeepAliveClien // Finalize editing, but don't give up focus because this keyboard // action does not imply the user is done inputting information. _finalizeEditing(action, shouldUnfocus: false); - case TextInputAction.removeFocus: - if (defaultTargetPlatform == TargetPlatform.ohos) { - widget.focusNode.unfocus(); - } } } @@ -3445,7 +3441,6 @@ class EditableTextState extends State with AutomaticKeepAliveClien widget.focusNode.nextFocus(); case TextInputAction.previous: widget.focusNode.previousFocus(); - default: } } } -- Gitee