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

Add interactive dismiss enabled to add full support for iOS 13 style page sheet modals #32285

Closed

Conversation

jacobp100
Copy link
Contributor

@jacobp100 jacobp100 commented Sep 28, 2021

Summary

Add interactive dismiss enabled to add full support for iOS 13 style page sheet modals

See #31500

In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this commit to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know.

In the current behaviour, there's friction when dismissing. This enables removing that friction via a new interactiveDismissEnabled prop.

When using this prop, you must implement onDismiss - and that callback must lead to setting visible: false.

I felt this was consistent, because onDismiss was called when a modal was fully dismissed. When using the interactive dismissal, we only get notified when it's actually dismissed.

This feature is opt-in to maintain backwards compatibility.

Changelog

[iOS] [Added] - Added interactiveDismissEnabled prop to Modal component

Test Plan

Added example in RN tester. Video below.

Screen.Recording.2021-09-28.at.19.07.35.mov

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Sep 28, 2021
@analysis-bot
Copy link

analysis-bot commented Sep 28, 2021

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 16397e0
Branch: main

@analysis-bot
Copy link

analysis-bot commented Sep 28, 2021

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,810,106 +375
android hermes armeabi-v7a 7,201,790 +380
android hermes x86 8,118,851 +378
android hermes x86_64 8,099,084 +434
android jsc arm64-v8a 9,643,975 +399
android jsc armeabi-v7a 8,418,241 +412
android jsc x86 9,593,192 +423
android jsc x86_64 10,190,400 +452

Base commit: 16397e0
Branch: main

@react-native-bot react-native-bot added Platform: iOS iOS applications. Type: Enhancement A new feature or enhancement of an existing feature. labels Oct 1, 2021
@vbylen
Copy link

vbylen commented Jan 28, 2022

Any hope of this being merged?

@jacobp100
Copy link
Contributor Author

I've fixed the merge conflicts

@jacobp100
Copy link
Contributor Author

I believe this has already been merged in via other PRs

@jacobp100 jacobp100 closed this Oct 21, 2022
@burakgormek
Copy link

I think this still needed, or am I missing something? Mentioned PR doesn't seem to have this functionality.

@erquhart
Copy link

erquhart commented Oct 5, 2023

@jacobp100 this was never merged or addressed in other PR's, any chance of revisiting? There is currently no way to present a native modal in iOS that can be dismissed smoothly via swipe down, including community libraries. We really need this.

@erquhart
Copy link

erquhart commented Oct 5, 2023

Actually it looks like this is superseded by: #38641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: iOS iOS applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants