Commit 7334084
authored
fix(iOS, Stack v4): hide back button when root screen is replaced with
## Description
Fixes replacing root screen with `pop` animation by hiding back button.
Previously, back button would appear during the animation even though
there was no reason for it to be visible. This is closely related how
we're handling replace with `pop` animation (we're adding previous top
controller and immediately popping it with animation; UIKit "thinks"
that there is a screen to pop to so it displays back button).
Thanks to @satya164 for reporting the issue.
When testing the change I discovered another bug - when replacing
non-root screen, back button title disappears:
https://github.com/user-attachments/assets/7e45f71b-9df6-4a11-847e-75fe43618da0
This might be a native bug, I added a ticket on our internal board to
investigate:
software-mansion/react-native-screens-labs#1053.
## Changes
- add a check for root pop replace and hide back button in
`setPushViewControllers`
## Before & after - visual documentation
| Before | After |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/0e42e2d7-d71d-4805-b0b0-8ea3fc3b978a"
/> | <video
src="https://github.com/user-attachments/assets/81d1ce5f-b23c-40fa-ab55-05c18e266604"
/> |
## Test plan
Run `Test3770.tsx`.
## Checklist
- [x] Included code example that can be used to test this change.
- [x] For visual changes, included screenshots / GIFs / recordings
documenting the change.
- [ ] Ensured that CI passespop animation (#3770)1 parent 22fe56e commit 7334084
3 files changed
Lines changed: 77 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
738 | 747 | | |
739 | 748 | | |
740 | 749 | | |
| |||
0 commit comments