Commit 731e9fe
fix(fabric): remove autoresizingMask on ScrollView documentView to fix Text overflow
On macOS, the _containerView (NSScrollView's documentView) had
autoresizingMask set to FlexibleWidth | FlexibleHeight. This conflicts
with React's explicit frame management: when AppKit's NSClipView resizes
(e.g., during initial tile after mounting), autoresizing adds the clip
view's size delta to the container's dimensions, inflating it well beyond
the correct content size and producing massive horizontal and vertical
overflow on first render. Resizing the window triggers a React re-layout
that overwrites the corrupted frame, which is why the issue self-corrects.
The fix removes the autoresizingMask so React's layout system (via
updateState:) is the sole manager of the documentView's frame. This is
consistent with the Paper architecture, which never set autoresizingMask
on the documentView.
Fixes #2857
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 70f3149 commit 731e9fe
File tree
1 file changed
+6
-1
lines changed- packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView
1 file changed
+6
-1
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
| |||
0 commit comments