Commit 4e1d7c1
authored
fix(iOS, FormSheet): Add fallback for searching ScrollView which is inside SAV (#3479)
## Description
Fixes a regression in ScrollView with non-scrolling content when using
absolute styles. Adding a SAV into the hierarchy - as a workaround to
content's padding issues under the header on iOS 26 - broke the logic
for finding the ScrollView inside the `ScreenContentWrapper`, preventing
the frame correction from being applied properly. This PR adds fallbacks
to search for the `ScrollView` within the subviews of the
`SafeAreaView`.
> [!NOTE]
> Allowing the `flex:1` style for the `ContentWrapper` also resolves an
issue with ScrollView's `contentInsetsAdjustmentBehavior`, which now
works correctly with synchronous state updates enabled. It would be good
to align this behavior for the `absoluteWithNoBottom` style as well -
software-mansion/react-native-screens-labs#718
## Changes
- Added fallback logic to search within `SafeAreaView` subviews for
`ScrollView` in `ContentWrapper`.
## Screenshots / GIFs
Here you can add screenshots / GIFs documenting your change.
You can add before / after section if you're changing some behavior.
### Before
<table>
<tr>
<td width="50%">
<video
src="https://github.com/user-attachments/assets/013ea98e-c4ec-4c96-8963-4f2c6829da61"></video>
</td>
<td width="50%">
<video
src="https://github.com/user-attachments/assets/acef493d-a37e-482f-be67-a5c2a8ea746c"></video>
</td>
</tr>
</table>
### After
<table>
<tr>
<td width="50%">
<video
src="https://github.com/user-attachments/assets/7d96a236-4ba6-4b6a-8c1f-8f64871b1faa"></video>
</td>
<td width="50%">
<video
src="https://github.com/user-attachments/assets/3bbd69e1-8760-4246-9a21-50eb48e3e54a"></video>
</td>
</tr>
</table>
## Test code and steps to reproduce
Tested on TestFormSheet
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes1 parent c9b84ff commit 4e1d7c1
File tree
3 files changed
+56
-11
lines changed- ios
3 files changed
+56
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
902 | 903 | | |
903 | 904 | | |
904 | 905 | | |
905 | | - | |
| 906 | + | |
| 907 | + | |
906 | 908 | | |
907 | 909 | | |
908 | 910 | | |
| |||
916 | 918 | | |
917 | 919 | | |
918 | 920 | | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
919 | 935 | | |
920 | 936 | | |
921 | 937 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
110 | 111 | | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | | - | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
117 | 137 | | |
118 | 138 | | |
119 | 139 | | |
120 | 140 | | |
121 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
122 | 145 | | |
123 | 146 | | |
124 | 147 | | |
125 | 148 | | |
126 | 149 | | |
127 | | - | |
| 150 | + | |
128 | 151 | | |
129 | | - | |
| 152 | + | |
130 | 153 | | |
131 | | - | |
| 154 | + | |
| 155 | + | |
132 | 156 | | |
133 | 157 | | |
134 | | - | |
| 158 | + | |
135 | 159 | | |
136 | 160 | | |
137 | 161 | | |
| |||
143 | 167 | | |
144 | 168 | | |
145 | 169 | | |
146 | | - | |
| 170 | + | |
147 | 171 | | |
148 | 172 | | |
149 | 173 | | |
| |||
0 commit comments