You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: issues with presenting owned modals from foreign ones (#2113)
## Description
Basically this is another edition of the issue #1829 (handled by #1912).
The issue comes down to the fact, that our `ScreenStack` is not aware of
all modal view controllers being in presentation,
but this time it is not aware of third-party modal view controllers
(I've named them "foreign" modals in opposite to "owned" modals).
This PR is not a comprehensive solution but rather just a patch aiming
at fixing one particular interaction reported in #2048.
I've left verbose code comments explaining the issue and suggesting
solution in the source code, including:
```
// TODO: Find general way to manage owned and foreign modal view controllers and refactor this code. Consider building
// model first (data structue, attempting to be aware of all modals in presentation and some text-like algorithm for
// computing required operations).
```
Closes#2048Closes#2085
## Changes
Trigger dissmisal of foreign modal if it is presented above `changeRoot`
modal (last modal that is to stay on stack after the updates).
## Test code and steps to reproduce
`Test2048` in `TestsExample` & `FabricTestExample`.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes
// Issue: autohiding the Modal that serves as a bottom sheet unmounts
42
+
// the anchor component for the screen that is in { presentation: "modal" } mode
43
+
// Previously the anchoring component for a { presentation: "modal" }-based screen was different and it worked
44
+
// The culprit is: https://github.com/software-mansion/react-native-screens/pull/1912 released in https://github.com/software-mansion/react-native-screens/releases/tag/3.29.0
45
+
// adding setTimeout does not bring any good, because
46
+
// - we either don't see navigation action
47
+
// - we unmount both the bottom sheet modal and the screen itself
// Issue: autohiding the Modal that serves as a bottom sheet unmounts
42
+
// the anchor component for the screen that is in { presentation: "modal" } mode
43
+
// Previously the anchoring component for a { presentation: "modal" }-based screen was different and it worked
44
+
// The culprit is: https://github.com/software-mansion/react-native-screens/pull/1912 released in https://github.com/software-mansion/react-native-screens/releases/tag/3.29.0
45
+
// adding setTimeout does not bring any good, because
46
+
// - we either don't see navigation action
47
+
// - we unmount both the bottom sheet modal and the screen itself
0 commit comments