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(iOS): lack of animation on modal replacement (#2958)
## Description
The fix boils down to removing check whether `changeRootIndex ==
controllers.count`. It was introduced here:
#502.
It can be represented differently: `changeRootIndex ==
controllers.lastIndex + 1` & if I get this correctly it checks whether
the modal change in question takes place at the top of view hierarchy,
with purpose of not animating non visible changes.
It does not take account the replace operation though. In case of
replace, the `changeRootIndex == controllers.lastIndex`.
Another aspect is that I believe this part of the check is not
necessary. If some modal view controller is being dismissed, **all**
view controllers above it will also endup dismissed.
Therefore, there is no scenario where this check would be useful.
Hence, this commit ends up removing the check.
## Before & After
| before | after |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/d3a718e2-aef3-49bc-abdd-fa172c2097a3"
/> | <video
src="https://github.com/user-attachments/assets/e3b7c05c-fd9e-48b7-96e7-c59e75cd4c3f"
/> |
## Test code and steps to reproduce
I've enhanced `TestModalNavigation` with additional button that allows
for modal replacement.
I've also tested `TestModalNavigation` to make sure other flows keep
working.
I've also tested #502 - setting `animation: 'none'` keeps working for
dismissed modals.
## Checklist
- [x] Included code example that can be used to test this change
- [ ] Ensured that CI passes
0 commit comments