From 311d2fb0c55a1380b21a8d80da79c7c4e7ce2888 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 9 Mar 2021 11:52:25 -0800 Subject: [PATCH] Disable swipe down gesture in Modal component Summary: Changelog: [internal] Paper implementation prevents swipe to dismiss gesture in Modal. https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTModalHostViewController.m?commit=9d1f344633fb&lines=25-30 This diff implements the same in Fabric. Reviewed By: ShikaSD Differential Revision: D26910753 fbshipit-source-id: cb036ce0a9cd57c7d549a1a58eb941d8e64f2468 --- .../Modal/RCTFabricModalHostViewController.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm index dc852ff001da6d..feac1dd6d2117d 100644 --- a/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +++ b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm @@ -22,6 +22,13 @@ - (instancetype)init } _touchHandler = [RCTSurfaceTouchHandler new]; +#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 + return self; }