Skip to content

Fix ScrollView touch events ignored in contentInset area on iOS#56747

Closed
cbrevik wants to merge 1 commit into
facebook:mainfrom
cbrevik:fix-hit-scroll-hittest
Closed

Fix ScrollView touch events ignored in contentInset area on iOS#56747
cbrevik wants to merge 1 commit into
facebook:mainfrom
cbrevik:fix-hit-scroll-hittest

Conversation

@cbrevik
Copy link
Copy Markdown
Contributor

@cbrevik cbrevik commented May 10, 2026

Summary:

Fixes #54123

In RN 0.80, betterHitTest:withEvent: in RCTScrollViewComponentView was added, which returns self (the RCTScrollViewComponentView wrapper view) when a touch point falls inside the scroll view's bounds. This causes touches in the contentInset area — where no content is rendered — to be absorbed by the wrapper rather than forwarded to the underlying UIScrollView, making scroll gestures in that region completely non-functional.

The fix returns _scrollView instead of self, so hit-tested touches are correctly attributed to the UIScrollView and scrolling works throughout the full bounds, including the inset area.

Changelog:

[IOS] [FIXED] - Fix ScrollView touch events ignored in contentInset area on Fabric

Test Plan:

Couldn't use the snack-repro from #54123 since this requires a native change. But using the ScrollViewSimpleExample from the RNTester, and removing a lot of the items demonstrates the behaviour change.

The two videos show attempted dragging from the region below the ScrollView content.

Before: Dragging in the inset area does nothing — scroll view does not respond

Before-fix.mov

After: Dragging in the inset area scrolls the content correctly

After-fix.mov

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 10, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 10, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 11, 2026

@javache has imported this pull request. If you are a Meta employee, you can view this in D104644045.

@meta-codesync meta-codesync Bot closed this in efcab20 May 12, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cbrevik in efcab20

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 12, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 12, 2026

@javache merged this pull request in efcab20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrolling on contentInset area does nothing

2 participants