fix(0.81, fabric): force overlay scrollbar style in ScrollView#2908
Open
Saadnajmi wants to merge 1 commit into0.81-stablefrom
Open
fix(0.81, fabric): force overlay scrollbar style in ScrollView#2908Saadnajmi wants to merge 1 commit into0.81-stablefrom
Saadnajmi wants to merge 1 commit into0.81-stablefrom
Conversation
|
Force NSScrollerStyleOverlay on Fabric ScrollViews to avoid layout issues with legacy (always-visible) scrollbars. Legacy scrollbars sit inside the NSScrollView frame and reduce the clip view's visible area, which would require compensating padding in the Yoga shadow tree. Overlay scrollers float above content, so no layout compensation is needed. Additional fixes: - Remove autoresizingMask from documentView to prevent AppKit frame corruption during tile/resize - Remove the layoutSubviews workaround (no longer needed without autoresizingMask) - Add [_scrollView tile] after content size updates to re-evaluate scroller visibility - Fix hit testing: check NSScroller before content subviews so scrollbar clicks aren't swallowed by full-width content views Fixes #2857 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9c2bb94 to
1843a23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #2907 to
0.81-stable.NSScrollerStyleOverlayon Fabric ScrollViews to fix layout overflow on first renderautoresizingMaskfrom documentView to prevent AppKit frame corruptionNSScrollerbefore content subviews)Why force overlay instead of supporting legacy scrollbars?
Every other platform uses overlay scrollbars. iOS, Android, and web all render scrollbar indicators that float above content. Forcing overlay aligns macOS with every other React Native platform.
Supporting legacy scrollbars required invasive changes to ReactCommon. The alternative required cached atomic values, custom shadow node constructors, and padding adjustments in the Yoga layout pass — a significant cross-platform change for a single-platform edge case.
Apple themselves call non-overlay scrollbars "legacy." The API is literally
NSScrollerStyleLegacy. Mac Catalyst doesn't even respect this preference (always uses overlay).Test plan
Fixes #2857
🤖 Generated with Claude Code