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 iOS 15 UISheetPresentationController options #7322

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

svbutko
Copy link
Collaborator

@svbutko svbutko commented Oct 20, 2021

Implements: #7320
WIP 🚧

TODO:

  • Add TypeScript options
  • Add iOS options
  • Add iOS options converted for detents
  • Add iOS implementation
  • Add tests
  • Implement in playground app
  • Add website documentation

@svbutko
Copy link
Collaborator Author

svbutko commented Oct 20, 2021

image

@svbutko
Copy link
Collaborator Author

svbutko commented Oct 20, 2021

It works but there are two issues:

  • largestUndimmedDetent and selectedDetentIdentifier they need proper converters, I'm failing to create one with RCT_ENUM_CONVERTER in RNNConvert.m
  • detents share the same conversion issue mixed with probably incorrect parsing in RNNModalOptions

There are also a couple of concerns:

  • Are the place where I apply it and ViewController correct or not?
  • How to apply merge options correctly in this case here if it's possible?
  • I noticed a small lag when going from medium to large I'm not sure whether I'm alone with it or not

@grahammendick
Copy link

Hey @svbutko, I tried adding the native iOS bottom sheet to my Navigation router for React Native but I ran into trouble. The iOS bottom sheet is meant to resize when it’s dragged. For example, a button in the bottom right of the sheet stays in the bottom right as you expand/collapse it. I tried calling setSize in layoutSubviews so that React Native resizes it to match the native bounds. This nearly worked. It worked when dragging but didn’t work when letting go. If you drag the bottom sheet up a bit and then let go it collapses back but doesn't resize. It turns out that iOS doesn’t call layoutSubviews when animating it back to rest. Have you found the same problem?

@oferRounds
Copy link

@yogevbd is there any other work except for this pr towards adding the feature?

@grahammendick
Copy link

Hey, I just added Bottom Sheet support to my Navigation router on iOS. I removed the flicker I mentioned when the sheet is dropped. Details in the PR but let me know if you want to know more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants