Commit ae3196d
authored
fix(iOS,Fabric): fix sporadic exiting screen content jump on goBack action (#2838)
## Description
Fixes #2538
From time to time the **snapshot** of exiting screen would receive bad
frame from the OS during the transition
resulting in the visual bug depicted in #2538 and on video down below
:point_down:.
Basically what happens is described by logs present on the recording
below.
In JS initiated back transition we exchange the `screenView` with its
snapshot &
the snapshot **sometimes** receives UIKit-originated frame with origin
at `(0, 0)`.
I guess it happens only sporadically, because there is some race
condition, between
animation & layout depending on whether the navigation bar is still
attached in the model
tree or not.
There is no issue in natively initiated back transition.
https://github.com/user-attachments/assets/d9d90cac-4507-44ff-bda1-619b71b5da56
## Changes
I've decided to go with setting the snapshot frame directly on creation.
Given that the `screenView` has correct frame set (with header height
taken into account),
the snapshot will have correct frame.
## Test code and steps to reproduce
I've added simple `Test2538`, which you can test by going back and forth
between screens.
With the patch applied I haven't seen the issue even once.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes1 parent f44fe9c commit ae3196d
3 files changed
+43
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1914 | 1914 | | |
1915 | 1915 | | |
1916 | 1916 | | |
| 1917 | + | |
1917 | 1918 | | |
1918 | 1919 | | |
1919 | 1920 | | |
| |||
0 commit comments