mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[iOS] Fix:Keyboard inset is not correct when presenting and native ViewController on FlutterViewController (flutter/engine#29862)
This commit is contained in:
parent
7ae65f835d
commit
b4058bb068
@ -1200,9 +1200,10 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch)
|
||||
}
|
||||
completion:^(BOOL finished) {
|
||||
if (self.displayLink == currentDisplayLink) {
|
||||
// Indicates the displaylink captured by this block is the original one,which also
|
||||
// indicates the animation has not been interrupted from its beginning. Moreover,indicates
|
||||
// the animation is over and there is no more animation about to exectute.
|
||||
[self invalidateDisplayLink];
|
||||
}
|
||||
if (finished) {
|
||||
[self removeKeyboardAnimationView];
|
||||
[self ensureViewportMetricsIsCorrect];
|
||||
}
|
||||
|
||||
@ -173,9 +173,17 @@ typedef enum UIAccessibilityContrast : NSInteger {
|
||||
@"UIKeyboardAnimationDurationUserInfoKey" : [NSNumber numberWithDouble:0.25],
|
||||
@"UIKeyboardIsLocalUserInfoKey" : [NSNumber numberWithBool:isLocal]
|
||||
}];
|
||||
|
||||
XCTestExpectation* expectation = [self expectationWithDescription:@"update viewport"];
|
||||
OCMStub([mockEngine updateViewportMetrics:flutter::ViewportMetrics()])
|
||||
.ignoringNonObjectArgs()
|
||||
.andDo(^(NSInvocation* invocation) {
|
||||
[expectation fulfill];
|
||||
});
|
||||
id viewControllerMock = OCMPartialMock(viewController);
|
||||
[viewControllerMock keyboardWillChangeFrame:notification];
|
||||
OCMVerify([viewControllerMock startKeyBoardAnimation:0.25]);
|
||||
[self waitForExpectationsWithTimeout:5.0 handler:nil];
|
||||
}
|
||||
|
||||
- (void)testEnsureViewportMetricsWillInvokeAndDisplayLinkWillInvalidateInViewDidDisappear {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user