-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
fix(iOS): incorrect safe area on transparent modals using landscape orientation #2008
Conversation
if (!includingModals) { | ||
return nil; | ||
} | ||
|
||
// we don't want to allow controlling of status bar appearance when we present non-fullScreen modal | ||
// and it is not possible if `modalPresentationCapturesStatusBarAppearance` is not set to YES, so even | ||
// if we went into a modal here and ask it, it wouldn't take any effect. For fullScreen modals, the system | ||
// asks them by itself, so we can stop traversing here. | ||
// for screen orientation, we need to start the search again from that modal | ||
return !includingModals | ||
? nil | ||
: [(RNSScreen *)lastViewController findChildVCForConfigAndTrait:trait includingModals:includingModals] | ||
?: lastViewController; | ||
UIViewController *modalOrChild = [(RNSScreen *)lastViewController findChildVCForConfigAndTrait:trait | ||
includingModals:includingModals]; | ||
if (modalOrChild != nil) { | ||
return modalOrChild; | ||
} |
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.
To be honest I'm still thinking if this !includingModals
statement is still necessary. Let's look from the perspective of the logic - previously, when screen was providing a modal, this method was returning lastViewController
when the modal could not find any further child VCs on its way. When the screen was providing a modal and includingModals
was set to NO, the nil was being returned straight-forward.
Now, since we're going further when the modal can't find any child VCs, shouldn't we remove this if (we want to include modals in logic, not stop on them)? Or maybe the name includingModals
is misleading and we should change it? What do you think? I tested already the app without this if and it looks like it just works (however, updating lastViewController to return last child VC may be sufficient), but maybe you've got some objections? Please let me know!
My suggestion:
- remove if with
!includingModals
- replace further
if
with(modalOrChild != nil && includingModals)
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.
To be honest I'm still thinking if this !includingModals statement is still necessary.
I guess the comment below this if statement explains why do we return nil in such case.
I don't really understand the problem here, must admit, but if tests turned out positive we can go with current solution. I'm not decisive here, however.
Co-authored-by: Kacper Kafara <[email protected]>
5b75521
to
7bc9a1c
Compare
We've patched this fix into next week's iOS beta. Initial signs are positive that it's working, will see if any hidden issues come up during the week beta process. Thanks for fixing this so quickly! 🙏 |
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.
Seems alright, thanks!
if (!includingModals) { | ||
return nil; | ||
} | ||
|
||
// we don't want to allow controlling of status bar appearance when we present non-fullScreen modal | ||
// and it is not possible if `modalPresentationCapturesStatusBarAppearance` is not set to YES, so even | ||
// if we went into a modal here and ask it, it wouldn't take any effect. For fullScreen modals, the system | ||
// asks them by itself, so we can stop traversing here. | ||
// for screen orientation, we need to start the search again from that modal | ||
return !includingModals | ||
? nil | ||
: [(RNSScreen *)lastViewController findChildVCForConfigAndTrait:trait includingModals:includingModals] | ||
?: lastViewController; | ||
UIViewController *modalOrChild = [(RNSScreen *)lastViewController findChildVCForConfigAndTrait:trait | ||
includingModals:includingModals]; | ||
if (modalOrChild != nil) { | ||
return modalOrChild; | ||
} |
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.
To be honest I'm still thinking if this !includingModals statement is still necessary.
I guess the comment below this if statement explains why do we return nil in such case.
I don't really understand the problem here, must admit, but if tests turned out positive we can go with current solution. I'm not decisive here, however.
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-native-screens](https://togithub.com/software-mansion/react-native-screens) | [`^3.29.0` -> `^3.30.1`](https://renovatebot.com/diffs/npm/react-native-screens/3.29.0/3.30.1) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>software-mansion/react-native-screens (react-native-screens)</summary> ### [`v3.30.1`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.1) [Compare Source](https://togithub.com/software-mansion/react-native-screens/compare/3.30.0...3.30.1) Patch release addressing an issue with building a package due to the missing submodule from `postinstall` command. #### 🔢 Miscellaneous - Remove postinstall step from package.json by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2081](https://togithub.com/software-mansion/react-native-screens/pull/2081) **Full Changelog**: software-mansion/react-native-screens@3.30.0...3.30.1 ### [`v3.30.0`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.0) [Compare Source](https://togithub.com/software-mansion/react-native-screens/compare/3.29.0...3.30.0) Minor release including custom screen transitions, adding support for VisionOS, supporting `slide_from_left` animation on iOS and fixing other aspects (including wrong targets for touchable components on Fabric). Thanks for following along! 💙 **Note**: Please note that support for React Native versions lower than 0.68 have been **dropped**. Older versions may still continue to work with this and newer releases of react-native-screens, but bugs from deprecated versions will not be considered for repair. #### What's Changed #### 👍 Improvements - **Custom screen transitions** - In 3.30.0, we've introduced a support for custom transition animations while making a "go back" gesture. Made by [@​piaskowyk](https://togithub.com/piaskowyk) and [@​WoLewicki](https://togithub.com/WoLewicki) in [https://github.com/software-mansion/react-native-screens/pull/1913](https://togithub.com/software-mansion/react-native-screens/pull/1913) - **Support for VisionOS is here!** - From now, react-native-screens offers bundled support for VisionOS platform. Made by [@​okwasniewski](https://togithub.com/okwasniewski) in [https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025) - **`slide_from_left` transition on iOS** - You can use `slide_from_left` animation that will be used for pushing or popping a new screen. Made by [@​kirillzyusko](https://togithub.com/kirillzyusko) in [https://github.com/software-mansion/react-native-screens/pull/2057](https://togithub.com/software-mansion/react-native-screens/pull/2057) - Add `cancelSearch` command on SearchBar by [@​Jasonzj](https://togithub.com/Jasonzj) in [https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987) - Fixed Android screen stack animation by [@​janicduplessis](https://togithub.com/janicduplessis) in [https://github.com/software-mansion/react-native-screens/pull/2019](https://togithub.com/software-mansion/react-native-screens/pull/2019) #### 🐛 Bug fixes - Not working hitslop for headerRight/Left views by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/1995](https://togithub.com/software-mansion/react-native-screens/pull/1995) - App freeze when navigating back from any modal nested in contained modal by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/1996](https://togithub.com/software-mansion/react-native-screens/pull/1996) - Incorrect safe area on transparent modals using landscape orientation by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2008](https://togithub.com/software-mansion/react-native-screens/pull/2008) - Invalid orientation of contained modals by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2011](https://togithub.com/software-mansion/react-native-screens/pull/2011) - Modify the decorFitsSystemWindow parameter in setNavigationBarHidden by [@​jiyong1](https://togithub.com/jiyong1) in [https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988) - Avoid race condition related to state on the new arch by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024) - Check for multiple screens while changing screen orientation by [@​uzegonemad](https://togithub.com/uzegonemad) in [https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035) - Fix setting incorrect measure with native header by [@​WoLewicki](https://togithub.com/WoLewicki) and [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2028](https://togithub.com/software-mansion/react-native-screens/pull/2028) - Add notifying for header height change, fix header height values by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2075](https://togithub.com/software-mansion/react-native-screens/pull/2075) - Change context while running `runOnUiQueueThread` on 0.73 with Bridgeless by [@​cortinico](https://togithub.com/cortinico) in [https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022) - Use reactApplicationContext in onScreenChanged by [@​WoLewicki](https://togithub.com/WoLewicki) in [https://github.com/software-mansion/react-native-screens/pull/2046](https://togithub.com/software-mansion/react-native-screens/pull/2046) - Remove calculating status bar height in useAnimatedHeaderHeight when header is not shown by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2033](https://togithub.com/software-mansion/react-native-screens/pull/2033) - Handle setting `display` for `_viewConfig` attribute by [@​WoLewicki](https://togithub.com/WoLewicki) and [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2071](https://togithub.com/software-mansion/react-native-screens/pull/2071) - Fix crash with searchResultsController in RNSSearchBar by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2004](https://togithub.com/software-mansion/react-native-screens/pull/2004) - Add constraints for velocity in `goBackGesture` screen transition by [@​piaskowyk](https://togithub.com/piaskowyk) in [https://github.com/software-mansion/react-native-screens/pull/2061](https://togithub.com/software-mansion/react-native-screens/pull/2061) - Add view check for getting StackView in `goBackGesture` by [@​piaskowyk](https://togithub.com/piaskowyk) in [https://github.com/software-mansion/react-native-screens/pull/2060](https://togithub.com/software-mansion/react-native-screens/pull/2060) - Change default value of context of ScreenGestureDetector, add warning for goBackGesture by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2013](https://togithub.com/software-mansion/react-native-screens/pull/2013) - Move GHContext from gesture-handler to native-stack by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2017](https://togithub.com/software-mansion/react-native-screens/pull/2017) - Change default gesture from Tap to Fling, fix failing CI by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2023](https://togithub.com/software-mansion/react-native-screens/pull/2023) #### 🔢 Miscellaneous - **Drop React Native 0.64 - 0.67 since 3.30.0** by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2036](https://togithub.com/software-mansion/react-native-screens/pull/2036) - Remove mixed CJS/ESM, refactorize index.native.tsx by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/1982](https://togithub.com/software-mansion/react-native-screens/pull/1982) - Add react-navigation as submodule & use it in test applications by [@​kkafar](https://togithub.com/kkafar) and [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/1993](https://togithub.com/software-mansion/react-native-screens/pull/1993) - Unify member-field naming convention in Kotlin by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/1999](https://togithub.com/software-mansion/react-native-screens/pull/1999) - Update compatibility table with supported RN versions with Fabric by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/2001](https://togithub.com/software-mansion/react-native-screens/pull/2001) - Change name of `headerBackButtonClicked` event by [@​WoLewicki](https://togithub.com/WoLewicki) in [https://github.com/software-mansion/react-native-screens/pull/2015](https://togithub.com/software-mansion/react-native-screens/pull/2015) - Stabilize Android E2E tests by [@​kirillzyusko](https://togithub.com/kirillzyusko) in [https://github.com/software-mansion/react-native-screens/pull/2062](https://togithub.com/software-mansion/react-native-screens/pull/2062) - Update Podfiles in Example projects, update RN in FabricExample to 0.73 by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/1989](https://togithub.com/software-mansion/react-native-screens/pull/1989) - Update React Native to 0.73.4, change Cocoapods version by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2032](https://togithub.com/software-mansion/react-native-screens/pull/2032) - Configure yarn version in package.json by [@​bakkerjoeri](https://togithub.com/bakkerjoeri) in [https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077) - Bump ip from 1.1.8 to 1.1.9 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-screens/pull/2038](https://togithub.com/software-mansion/react-native-screens/pull/2038) - Bump ip from 1.1.8 to 1.1.9 in example apps by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2044](https://togithub.com/software-mansion/react-native-screens/pull/2044) #### New Contributors - [@​jiyong1](https://togithub.com/jiyong1) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988) - [@​Jasonzj](https://togithub.com/Jasonzj) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987) - [@​j-piasecki](https://togithub.com/j-piasecki) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024) - [@​cortinico](https://togithub.com/cortinico) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022) - [@​okwasniewski](https://togithub.com/okwasniewski) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025) - [@​uzegonemad](https://togithub.com/uzegonemad) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035) - [@​bakkerjoeri](https://togithub.com/bakkerjoeri) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077) #### 🙌 Thank you for your contributions! **Full Changelog**: software-mansion/react-native-screens@3.29.0...3.30.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: valora-bot <[email protected]>
…inc#5239) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-native-screens](https://togithub.com/software-mansion/react-native-screens) | [`^3.29.0` -> `^3.30.1`](https://renovatebot.com/diffs/npm/react-native-screens/3.29.0/3.30.1) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>software-mansion/react-native-screens (react-native-screens)</summary> ### [`v3.30.1`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.1) [Compare Source](https://togithub.com/software-mansion/react-native-screens/compare/3.30.0...3.30.1) Patch release addressing an issue with building a package due to the missing submodule from `postinstall` command. #### 🔢 Miscellaneous - Remove postinstall step from package.json by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2081](https://togithub.com/software-mansion/react-native-screens/pull/2081) **Full Changelog**: software-mansion/react-native-screens@3.30.0...3.30.1 ### [`v3.30.0`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.0) [Compare Source](https://togithub.com/software-mansion/react-native-screens/compare/3.29.0...3.30.0) Minor release including custom screen transitions, adding support for VisionOS, supporting `slide_from_left` animation on iOS and fixing other aspects (including wrong targets for touchable components on Fabric). Thanks for following along! 💙 **Note**: Please note that support for React Native versions lower than 0.68 have been **dropped**. Older versions may still continue to work with this and newer releases of react-native-screens, but bugs from deprecated versions will not be considered for repair. #### What's Changed #### 👍 Improvements - **Custom screen transitions** - In 3.30.0, we've introduced a support for custom transition animations while making a "go back" gesture. Made by [@​piaskowyk](https://togithub.com/piaskowyk) and [@​WoLewicki](https://togithub.com/WoLewicki) in [https://github.com/software-mansion/react-native-screens/pull/1913](https://togithub.com/software-mansion/react-native-screens/pull/1913) - **Support for VisionOS is here!** - From now, react-native-screens offers bundled support for VisionOS platform. Made by [@​okwasniewski](https://togithub.com/okwasniewski) in [https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025) - **`slide_from_left` transition on iOS** - You can use `slide_from_left` animation that will be used for pushing or popping a new screen. Made by [@​kirillzyusko](https://togithub.com/kirillzyusko) in [https://github.com/software-mansion/react-native-screens/pull/2057](https://togithub.com/software-mansion/react-native-screens/pull/2057) - Add `cancelSearch` command on SearchBar by [@​Jasonzj](https://togithub.com/Jasonzj) in [https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987) - Fixed Android screen stack animation by [@​janicduplessis](https://togithub.com/janicduplessis) in [https://github.com/software-mansion/react-native-screens/pull/2019](https://togithub.com/software-mansion/react-native-screens/pull/2019) #### 🐛 Bug fixes - Not working hitslop for headerRight/Left views by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/1995](https://togithub.com/software-mansion/react-native-screens/pull/1995) - App freeze when navigating back from any modal nested in contained modal by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/1996](https://togithub.com/software-mansion/react-native-screens/pull/1996) - Incorrect safe area on transparent modals using landscape orientation by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2008](https://togithub.com/software-mansion/react-native-screens/pull/2008) - Invalid orientation of contained modals by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2011](https://togithub.com/software-mansion/react-native-screens/pull/2011) - Modify the decorFitsSystemWindow parameter in setNavigationBarHidden by [@​jiyong1](https://togithub.com/jiyong1) in [https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988) - Avoid race condition related to state on the new arch by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024) - Check for multiple screens while changing screen orientation by [@​uzegonemad](https://togithub.com/uzegonemad) in [https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035) - Fix setting incorrect measure with native header by [@​WoLewicki](https://togithub.com/WoLewicki) and [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2028](https://togithub.com/software-mansion/react-native-screens/pull/2028) - Add notifying for header height change, fix header height values by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2075](https://togithub.com/software-mansion/react-native-screens/pull/2075) - Change context while running `runOnUiQueueThread` on 0.73 with Bridgeless by [@​cortinico](https://togithub.com/cortinico) in [https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022) - Use reactApplicationContext in onScreenChanged by [@​WoLewicki](https://togithub.com/WoLewicki) in [https://github.com/software-mansion/react-native-screens/pull/2046](https://togithub.com/software-mansion/react-native-screens/pull/2046) - Remove calculating status bar height in useAnimatedHeaderHeight when header is not shown by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2033](https://togithub.com/software-mansion/react-native-screens/pull/2033) - Handle setting `display` for `_viewConfig` attribute by [@​WoLewicki](https://togithub.com/WoLewicki) and [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2071](https://togithub.com/software-mansion/react-native-screens/pull/2071) - Fix crash with searchResultsController in RNSSearchBar by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2004](https://togithub.com/software-mansion/react-native-screens/pull/2004) - Add constraints for velocity in `goBackGesture` screen transition by [@​piaskowyk](https://togithub.com/piaskowyk) in [https://github.com/software-mansion/react-native-screens/pull/2061](https://togithub.com/software-mansion/react-native-screens/pull/2061) - Add view check for getting StackView in `goBackGesture` by [@​piaskowyk](https://togithub.com/piaskowyk) in [https://github.com/software-mansion/react-native-screens/pull/2060](https://togithub.com/software-mansion/react-native-screens/pull/2060) - Change default value of context of ScreenGestureDetector, add warning for goBackGesture by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2013](https://togithub.com/software-mansion/react-native-screens/pull/2013) - Move GHContext from gesture-handler to native-stack by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2017](https://togithub.com/software-mansion/react-native-screens/pull/2017) - Change default gesture from Tap to Fling, fix failing CI by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2023](https://togithub.com/software-mansion/react-native-screens/pull/2023) #### 🔢 Miscellaneous - **Drop React Native 0.64 - 0.67 since 3.30.0** by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2036](https://togithub.com/software-mansion/react-native-screens/pull/2036) - Remove mixed CJS/ESM, refactorize index.native.tsx by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/1982](https://togithub.com/software-mansion/react-native-screens/pull/1982) - Add react-navigation as submodule & use it in test applications by [@​kkafar](https://togithub.com/kkafar) and [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/1993](https://togithub.com/software-mansion/react-native-screens/pull/1993) - Unify member-field naming convention in Kotlin by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/1999](https://togithub.com/software-mansion/react-native-screens/pull/1999) - Update compatibility table with supported RN versions with Fabric by [@​kkafar](https://togithub.com/kkafar) in [https://github.com/software-mansion/react-native-screens/pull/2001](https://togithub.com/software-mansion/react-native-screens/pull/2001) - Change name of `headerBackButtonClicked` event by [@​WoLewicki](https://togithub.com/WoLewicki) in [https://github.com/software-mansion/react-native-screens/pull/2015](https://togithub.com/software-mansion/react-native-screens/pull/2015) - Stabilize Android E2E tests by [@​kirillzyusko](https://togithub.com/kirillzyusko) in [https://github.com/software-mansion/react-native-screens/pull/2062](https://togithub.com/software-mansion/react-native-screens/pull/2062) - Update Podfiles in Example projects, update RN in FabricExample to 0.73 by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/1989](https://togithub.com/software-mansion/react-native-screens/pull/1989) - Update React Native to 0.73.4, change Cocoapods version by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2032](https://togithub.com/software-mansion/react-native-screens/pull/2032) - Configure yarn version in package.json by [@​bakkerjoeri](https://togithub.com/bakkerjoeri) in [https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077) - Bump ip from 1.1.8 to 1.1.9 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-screens/pull/2038](https://togithub.com/software-mansion/react-native-screens/pull/2038) - Bump ip from 1.1.8 to 1.1.9 in example apps by [@​tboba](https://togithub.com/tboba) in [https://github.com/software-mansion/react-native-screens/pull/2044](https://togithub.com/software-mansion/react-native-screens/pull/2044) #### New Contributors - [@​jiyong1](https://togithub.com/jiyong1) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988) - [@​Jasonzj](https://togithub.com/Jasonzj) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987) - [@​j-piasecki](https://togithub.com/j-piasecki) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024) - [@​cortinico](https://togithub.com/cortinico) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022) - [@​okwasniewski](https://togithub.com/okwasniewski) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025) - [@​uzegonemad](https://togithub.com/uzegonemad) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035) - [@​bakkerjoeri](https://togithub.com/bakkerjoeri) made their first contribution in [https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077) #### 🙌 Thank you for your contributions! **Full Changelog**: software-mansion/react-native-screens@3.29.0...3.30.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: valora-bot <[email protected]>
…rientation (software-mansion#2008) ## Description Normally, while opening a modal, each screen should preserve its safe area, depending on the screen orientation. Unfortunately, when user dismisses transparent modals, safe area of the origin screen breaks, resulting in the vertical safe area on landscape orientation. Because of that, I investigated the logic behind the final decision of screen orientations and it looks like the problem was lying on `supportedScreenOrientations` method in RNSScreen.mm file. 1. First, the modal was being asked for its supported device orientation. Once it reached the `supportedScreenOrientations` method, it was asking for config of childVC. Because the childVC was `nil` and the orientation wasn't set in screen options, it was returning `nil`, resulting in returning all orientations without `upside down`. 2. After that, there was a time for looking onto child VCs of a screen behind the modal. Since it was presenting a modal, it was first checking for its last child - since it didn't provide any modal and it haven't got any children, the last child was also `nil`, resulting in returning the modal as an orientation of the screen. 3. Returning a modal is (probably) a bad idea here, since it does not have any screen orientation specified, resulting in returning `nil` as a screen orientation. This was probably resulting a bug with wrong safe area. This PR changes this bad behavior by not returning `lastViewController` (which is a modal that is being presented from a screen) and going further for looking a config in child view controllers. However, this behavior may lead to the further bugs we haven't discovered yet. ## Changes - Changed `return` statement in `findChildVCForConfigAndTrait` method. ## Screenshots / GIFs ### Before https://github.com/software-mansion/react-native-screens/assets/23281839/6ff888d9-a7df-466c-ac45-d3db1cbe928c ### After https://github.com/software-mansion/react-native-screens/assets/23281839/dfc03a6c-ca7a-49a0-9c3e-7f019f7d405c ## Test code and steps to reproduce You can check Test2008 in `TestsExample` and `FabricTestExample` in order to tests how transparent modals behave. ## Checklist - [X] Included code example that can be used to test this change - [X] Ensured that CI passes --------- Co-authored-by: Kacper Kafara <[email protected]>
Description
Normally, while opening a modal, each screen should preserve its safe area, depending on the screen orientation. Unfortunately, when user dismisses transparent modals, safe area of the origin screen breaks, resulting in the vertical safe area on landscape orientation.
Because of that, I investigated the logic behind the final decision of screen orientations and it looks like the problem was lying on
supportedScreenOrientations
method in RNSScreen.mm file.supportedScreenOrientations
method, it was asking for config of childVC. Because the childVC wasnil
and the orientation wasn't set in screen options, it was returningnil
, resulting in returning all orientations withoutupside down
.nil
, resulting in returning the modal as an orientation of the screen.nil
as a screen orientation. This was probably resulting a bug with wrong safe area.This PR changes this bad behavior by not returning
lastViewController
(which is a modal that is being presented from a screen) and going further for looking a config in child view controllers.However, this behavior may lead to the further bugs we haven't discovered yet.
Changes
return
statement infindChildVCForConfigAndTrait
method.Screenshots / GIFs
Before
8mb.video-sIp-hTxqFeUR.mp4
After
8mb.video-A3U-bQKlTe4h.mp4
Test code and steps to reproduce
You can check Test2008 in
TestsExample
andFabricTestExample
in order to tests how transparent modals behave.Checklist