Commit f3650be
fix(fabric): fix Text overflow in ScrollView on first render (macOS)
On macOS, the _containerView (NSScrollView's documentView) has
autoresizingMask set so it fills the visible area before React's first
layout pass. However, AppKit's autoresizing corrupts the documentView's
frame by adding the NSClipView's size delta to the container's
dimensions (e.g., during initial tile or window attachment), inflating it
well beyond the correct content size and producing massive horizontal and
vertical overflow on first render.
The fix adds a layoutSubviews override on macOS that resets the
documentView frame to the correct React-managed content size after
AppKit's layout pass (which triggers autoresizing). This corrects the
corruption while preserving the autoresizingMask needed for the
documentView to fill the visible area before React's first updateState.
Fixes #2857
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 70f3149 commit f3650be
File tree
1 file changed
+24
-0
lines changed- packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView
1 file changed
+24
-0
lines changedLines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
187 | 211 | | |
188 | 212 | | |
189 | 213 | | |
| |||
0 commit comments