diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 827cd377c19..4824835fa10 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -2810,11 +2810,8 @@ static BOOL IsSelectionRectBoundaryCloserToPoint(CGPoint point, [self removeEnableFlutterTextInputViewAccessibilityTimer]; _activeView.accessibilityEnabled = NO; [_activeView resignFirstResponder]; - // Removes the focus from the `_activeView` (UIView) - // when the user stops typing (keyboard is hidden). - // For more details, refer to the discussion at: - // https://github.com/flutter/engine/pull/57209#discussion_r1905942577 - [self cleanUpViewHierarchy:YES clearText:YES delayRemoval:NO]; + [_activeView removeFromSuperview]; + [_inputHider removeFromSuperview]; } - (void)triggerAutofillSave:(BOOL)saveEntries { diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm index 42e71551de3..11cbd4cde03 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm @@ -2721,27 +2721,6 @@ FLUTTER_ASSERT_ARC XCTAssertNil(textInputPlugin.activeView.textInputDelegate); } -- (void)testAutoFillDoesNotTriggerOnHideButTriggersOnCommit { - // Regression test for https://github.com/flutter/flutter/issues/145681. - NSMutableDictionary* configuration = self.mutableTemplateCopy; - [configuration setValue:@{ - @"uniqueIdentifier" : @"field1", - @"hints" : @[ UITextContentTypePassword ], - @"editingValue" : @{@"text" : @""} - } - forKey:@"autofill"]; - [configuration setValue:@[ [configuration copy] ] forKey:@"fields"]; - - [self setClientId:123 configuration:configuration]; - XCTAssertEqual(self.viewsVisibleToAutofill.count, 1ul); - - [self setTextInputHide]; - // Before the fix in https://github.com/flutter/flutter/pull/160653, it was 0ul. - XCTAssertEqual(self.viewsVisibleToAutofill.count, 1ul); - - [self commitAutofillContextAndVerify]; -} - #pragma mark - Accessibility - Tests - (void)testUITextInputAccessibilityNotHiddenWhenShowed {