Repository navigation
Commit ff78e95
Fix iOS removeClippedSubviews being lost on recycled views (#58915)
Summary:
On iOS, `prepareForRecycle` resets `_removeClippedSubviews` to `NO` but keeps `_props`, and `updateProps:oldProps:` only set the flag when `removeClippedSubviews` differed from `_props`. So a recycled view whose previous props also had `removeClippedSubviews` never turned clipping back on, and a remounted `ScrollView`/`FlatList` kept every row attached. This compares against `_removeClippedSubviews` itself, and adds a test.
Fixes #58914. Repro: https://github.com/mozzius/view-remove-clipped-subviews-recycle-repro
## Changelog:
[IOS] [FIXED] - removeClippedSubviews is kept on recycled views
Pull Request resolved: #58915
Test Plan:
In the repro (a `ScrollView` with `removeClippedSubviews` and 100 rows, unmounted and mounted again), the recycled content view keeps all 100/100 rows attached on every remount without this change (7/7, including 3/3 on unmodified 0.87.1), and 7/100 with it (3/3), the same as on first mount. The new `RCTViewComponentViewTests` case, run inside the repro app against 0.87.1 built from source, fails without the change and passes with it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Reviewed By: sammy-SC
Differential Revision: D123878627
Pulled By: cipolleschi
fbshipit-source-id: 21d792698d74805f61a9a93f5b944d8f5abcd7f31 parent 268b302 commit ff78e95
2 files changed
Lines changed: 23 additions & 1 deletion
File tree
- packages/react-native/React
- Fabric/Mounting/ComponentViews/View
- Tests/Mounting
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
146 | 166 | | |
147 | 167 | | |
148 | 168 | | |
| |||
0 commit comments