Skip to content

Commit

Permalink
Prevent modal dismissal with swipe gestures
Browse files Browse the repository at this point in the history
Summary:
(Fixing the problems in this diff https://our.intern.facebook.com/intern/diff/D19836548/)

iOS 13 introduced interactive dismissal for modals https://medium.com/hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e.
This breaks react modals. We're disabling this feature for react modals
Changelog: [iOS][Fixed]  Prevent interactive dismissal for non-fullscreen modals

Reviewed By: shergin

Differential Revision: D19880343

fbshipit-source-id: e2ad82db3dd827812824862f432d549c865216b9
  • Loading branch information
saumyamukul authored and facebook-github-bot committed Feb 21, 2020
1 parent 8ce27df commit 1e7ed81
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions React/Views/RCTModalHostViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ - (instancetype)init
return nil;
}

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
if (@available(iOS 13.0, *)) {
self.modalInPresentation = YES;
}
#endif

#if !TARGET_OS_TV
_preferredStatusBarStyle = [RCTSharedApplication() statusBarStyle];
_preferredStatusBarHidden = [RCTSharedApplication() isStatusBarHidden];
Expand Down

0 comments on commit 1e7ed81

Please sign in to comment.