Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Add keyboardSize in "keyboard" event. (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
wqyfavor authored and cxfeng1 committed Oct 9, 2018
1 parent 875a5eb commit e13b599
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,9 @@ - (void)keyboardWasShown:(NSNotification*)notification
if(![self.view isFirstResponder]) {
return;
}

CGRect end = [[[notification userInfo] objectForKey:@"UIKeyboardFrameEndUserInfoKey"] CGRectValue];
if (!_disableMoveViewUp) {
CGRect end = [[[notification userInfo] objectForKey:@"UIKeyboardFrameEndUserInfoKey"] CGRectValue];
_keyboardSize = end.size;
UIView * rootView = self.weexInstance.rootView;
CGRect screenRect = [[UIScreen mainScreen] bounds];
Expand All @@ -922,7 +923,7 @@ - (void)keyboardWasShown:(NSNotification*)notification
}

if (_keyboardEvent) {
[self fireEvent:@"keyboard" params:@{ @"isShow": @YES }];
[self fireEvent:@"keyboard" params:@{ @"isShow": @YES, @"keyboardSize": @{@"width": @(end.size.width), @"height": @(end.size.height)} }];
}

_keyboardHidden = NO;
Expand Down

0 comments on commit e13b599

Please sign in to comment.