Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f71b7ee

Browse files
authored
Revert "Fix iOS password autofill prompt dismissal causes layout to resize (#50364)" (#50760)
This reverts commit 472df41. Reverts #50364 fixes flutter/flutter#143642 *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 70a194c commit f71b7ee

File tree

2 files changed

+0
-63
lines changed

2 files changed

+0
-63
lines changed

shell/platform/darwin/ios/framework/Source/FlutterViewController.mm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,15 +1520,6 @@ - (void)handleKeyboardNotification:(NSNotification*)notification {
15201520
BOOL keyboardAnimationIsCompounding =
15211521
self.keyboardAnimationIsShowing == keyboardWillShow && _keyboardAnimationVSyncClient != nil;
15221522

1523-
// Avoid triggering startKeyBoardAnimation when keyboard notifications are triggered
1524-
// by the dismissal of password autofill prompt. When this happens, there is
1525-
// no keyboard on the screen and FlutterTextInputViewAccessibilityHider is nil.
1526-
FlutterTextInputPlugin* textInputPlugin = self.engine.textInputPlugin;
1527-
UIView* textInputHider = [[textInputPlugin textInputView] superview];
1528-
if (keyboardWillShow && textInputHider == nil) {
1529-
return;
1530-
}
1531-
15321523
// Mark keyboard as showing or hiding.
15331524
self.keyboardAnimationIsShowing = keyboardWillShow;
15341525

shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,6 @@ - (void)testKeyboardAnimationIsShowingAndCompounding {
305305
FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine
306306
nibName:nil
307307
bundle:nil];
308-
FlutterMethodCall* setClientCall =
309-
[FlutterMethodCall methodCallWithMethodName:@"TextInput.setClient"
310-
arguments:@[ @(123), @{@"autocorrect" : @YES} ]];
311-
[engine.textInputPlugin handleMethodCall:setClientCall
312-
result:^(id _Nullable result){
313-
}];
314-
315-
// Check if FlutterTextInputViewAccessibilityHider exists.
316-
FlutterTextInputPlugin* textInputPlugin = engine.textInputPlugin;
317-
UIView* textInputHider = [[textInputPlugin textInputView] superview];
318-
XCTAssertNotNil(textInputHider);
319-
320308
FlutterViewController* viewControllerMock = OCMPartialMock(viewController);
321309
UIScreen* screen = [self setUpMockScreen];
322310
CGRect viewFrame = screen.bounds;
@@ -2200,46 +2188,4 @@ - (void)testFlutterViewControllerStartKeyboardAnimationWillCreateVsyncClientCorr
22002188
XCTAssertNil(viewController.keyboardAnimationVSyncClient);
22012189
}
22022190

2203-
- (void)testAvoidKeyboardAnimationWhenFlutterTextInputViewAccessibilityHiderIsNil {
2204-
FlutterEngine* engine = [[FlutterEngine alloc] init];
2205-
[engine runWithEntrypoint:nil];
2206-
FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engine
2207-
nibName:nil
2208-
bundle:nil];
2209-
2210-
FlutterViewController* viewControllerMock = OCMPartialMock(viewController);
2211-
UIScreen* screen = [self setUpMockScreen];
2212-
CGRect viewFrame = screen.bounds;
2213-
[self setUpMockView:viewControllerMock
2214-
screen:screen
2215-
viewFrame:viewFrame
2216-
convertedFrame:viewFrame];
2217-
2218-
CGFloat screenHeight = screen.bounds.size.height;
2219-
CGFloat screenWidth = screen.bounds.size.height;
2220-
2221-
// Check if FlutterTextInputViewAccessibilityHider is nil.
2222-
FlutterTextInputPlugin* textInputPlugin = engine.textInputPlugin;
2223-
UIView* textInputHider = [[textInputPlugin textInputView] superview];
2224-
XCTAssertNil(textInputHider);
2225-
2226-
// Start show keyboard animation.
2227-
CGRect showKeyboardBeginFrame = CGRectMake(0, screenHeight, screenWidth, 250);
2228-
CGRect showKeyboardEndFrame = CGRectMake(0, screenHeight - 250, screenWidth, 250);
2229-
NSNotification* fakeNotification =
2230-
[NSNotification notificationWithName:UIKeyboardWillChangeFrameNotification
2231-
object:nil
2232-
userInfo:@{
2233-
@"UIKeyboardFrameBeginUserInfoKey" : @(showKeyboardBeginFrame),
2234-
@"UIKeyboardFrameEndUserInfoKey" : @(showKeyboardEndFrame),
2235-
@"UIKeyboardAnimationDurationUserInfoKey" : @(0.25),
2236-
@"UIKeyboardIsLocalUserInfoKey" : @(YES)
2237-
}];
2238-
2239-
viewControllerMock.targetViewInsetBottom = 0;
2240-
[viewControllerMock handleKeyboardNotification:fakeNotification];
2241-
BOOL isShowingAnimation = viewControllerMock.keyboardAnimationIsShowing;
2242-
XCTAssertFalse(isShowingAnimation);
2243-
}
2244-
22452191
@end

0 commit comments

Comments
 (0)