Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set window.viewInsets.bottom to keyboard height on iOS #4420

Merged
merged 1 commit into from
Dec 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -656,17 +656,19 @@ - (void)keyboardWillChangeFrame:(NSNotification*)notification {
NSDictionary* info = [notification userInfo];
CGFloat bottom = CGRectGetHeight([[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]);
CGFloat scale = [UIScreen mainScreen].scale;
// TODO(cbracken): Once framework has been updated to use view insets, keyboard should change
// insets rather than padding.
// _viewportMetrics.physical_view_inset_bottom = bottom * scale;
_viewportMetrics.physical_view_inset_bottom = bottom * scale;

// TODO(cbracken): Once framework has been updated to use view insets for keyboard padding,
// eliminate this line.
_viewportMetrics.physical_padding_bottom = bottom * scale;
[self updateViewportMetrics];
}

- (void)keyboardWillBeHidden:(NSNotification*)notification {
// TODO(cbracken): Once framework has been updated to use view insets, keyboard should change
// insets rather than padding.
// _viewportMetrics.physical_view_inset_bottom = 0;
_viewportMetrics.physical_view_inset_bottom = 0;

// TODO(cbracken): Once framework has been updated to use view insets for keyboard padding,
// eliminate this line.
_viewportMetrics.physical_padding_bottom = 0;
[self updateViewportMetrics];
}
Expand Down