From 2bc40d5bb3c7f9bf127e2079665d8c8745e1615a Mon Sep 17 00:00:00 2001 From: Ken Mickles Date: Tue, 3 Oct 2017 13:57:57 -0400 Subject: [PATCH] Make disableScroll work with iOS 11 safe area insets --- src/ios/IonicKeyboard.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ios/IonicKeyboard.m b/src/ios/IonicKeyboard.m index d072ca7..5bd8ef5 100644 --- a/src/ios/IonicKeyboard.m +++ b/src/ios/IonicKeyboard.m @@ -119,7 +119,12 @@ - (void)setStyleDark:(BOOL)styleDark { /* ------------------------------------------------------------- */ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { - [scrollView setContentOffset: CGPointZero]; + if (@available(iOS 11.0, *)) { + [scrollView setContentOffset: CGPointMake(0.0, self.webView.safeAreaInsets.top * -1)]; + } + else { + [scrollView setContentOffset: CGPointZero]; + } } /* ------------------------------------------------------------- */