-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
feat(iOS): sheetInitialDetent support #2367
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid, good job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not tested the runtime though, make sure it works as expected & we're good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave premature approval - have one question
@kkafar I updated the PR. Tested on iOS 15.5 and iOS 18 successfully |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question
if (@available(iOS 16.0, *)) { | ||
if (_sheetAllowedDetents.count > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this swap done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_sheetAllowedDetents.count > 0 is true in most cases. Nothing would happen on iOS < 16 as such case isn't handled inside the condition. After swapping them both versions work correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid 💪🏻
if (@available(iOS 16.0, *)) { | ||
if (_sheetAllowedDetents.count > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, thanks!
## Description This PR adds `sheetInitialDetent` support to iOS and fixes detents logic on iOS < 16. This functionality depends on changes made in this PR: react-navigation/react-navigation#12032 ## Changes - supporting `sheetInitialDetent` on iOS - modified `Test2002.tsx` repro - updated README definition to match types - fixed `sheetAllowedDetents` on iOS < 16 <!-- ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before ### After --> ## Test code and steps to reproduce - Use `Test2002.tsx` repro ## Checklist - [x] Included code example that can be used to test this change - [x] Updated documentation: <!-- For adding new props to native-stack --> - [x] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [x] Ensured that CI passes
Description
This PR adds
sheetInitialDetent
support to iOS and fixes detents logic on iOS < 16.This functionality depends on changes made in this PR: react-navigation/react-navigation#12032
Changes
sheetInitialDetent
on iOSTest2002.tsx
reprosheetAllowedDetents
on iOS < 16Test code and steps to reproduce
Test2002.tsx
reproChecklist