Commit ab4464d
authored
fix(iOS, Stack v4): Fix reattaching screens which have preventNativeDismiss set (#3886)
## Description
When a user triggers a native back gesture on iOS, UIKit automatically
removes the screen from its parent. For screens where
`preventNativeDismiss` is set to true, the screen might be reattached to
the hierarchy, what's causing state desynchronization between JS and
native, because natively we're filtering out this screen from
`viewControllers` that was introduced in:
#3584
Note: I intentionally added this check only to 'card' presentation. For
modals, `preventNativeDismiss` is fired before detaching the modal from
the hierarchy, so the issue with reattaching isn't reproducible.
Closes:
#3885
## Changes
- excluded screens that have `preventNativeDismiss` option set from our
solution for preventing reattaching screens that were removed from the
hierarchy
## Before & after - visual documentation
| Before | After |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/3571ff56-e3be-4ea1-ad60-f57974efa59f"
/> | <video
src="https://github.com/user-attachments/assets/79a79c29-504e-4657-bbf9-ff0e079a6490"
/> |
## Test plan
Added Test3885, performed regression testing on Test2559
## Checklist
- [ ] Included code example that can be used to test this change.
- [ ] For visual changes, included screenshots / GIFs / recordings
documenting the change.
- [ ] For API changes, updated relevant public types.
- [ ] Ensured that CI passes1 parent e7ef00c commit ab4464d
3 files changed
Lines changed: 97 additions & 1 deletion
| 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 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
707 | 715 | | |
708 | 716 | | |
709 | 717 | | |
| |||
0 commit comments