-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement onRequestClose for iOS 13+ modals (#27618)
Summary: Starting on iOS 13, a View Controller presented modally will have a "bottom sheet" style unless it's explicitly presented full screen. Before this, modals on iOS were only being dismissed programatically by setting `visible={false}`. However, now that the dismissal can happen on the OS side, we need a callback to be able to update the state. This PR reuses the `onRequestClose` prop already available for tvOS and Android, and makes it work on iOS for this use case. Should fix #26892 ## Changelog [iOS] [Added] - Add support for onRequestClose prop to Modal on iOS 13+ Pull Request resolved: #27618 Test Plan: I tested this using the RNTester app with the Modal example: 1. Select any presentation style other than the full screen ones 2. Tap Present and the modal is presented 3. Swipe down on the presented modal until dismissed 4. Tap Present again and a second modal should be presented ![Screen Recording 2019-12-26 at 14 05 33](https://user-images.githubusercontent.com/8739/71477208-0ac88c80-27e9-11ea-9342-8631426a9b80.gif) Differential Revision: D19235758 Pulled By: shergin fbshipit-source-id: c0f1d946c77ce8d1baab209eaef7eb64697851df
- Loading branch information
1 parent
6be37d8
commit 8e5fac8
Showing
6 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters