fix(android): support NestedScrollView in ClippingScrollViewDecoratorView#1527
Merged
kirillzyusko merged 1 commit intoJul 2, 2026
Conversation
…View With React Native's `useNestedScrollViewAndroid` feature flag (RN 0.85+, react/react-native#55239), ScrollView renders as ReactNestedScrollView, which extends androidx.core.widget.NestedScrollView (a FrameLayout), not android.widget.ScrollView. `findScrollView` never matched it, so `decorateScrollView` silently no-oped and `contentInsetBottom`/ `contentInsetTop` were dropped entirely: KeyboardChatScrollView content hid behind composers and `blankSpace`/`extraContentPadding` did nothing. Match NestedScrollView as well and pass the target around as ViewGroup; every member the decorator and the padding-scroll workaround use (clipToPadding, getChildAt, setPadding, scrollBy, scrollY, canScrollVertically, getLocationOnScreen) lives on ViewGroup/View, and NestedScrollView extends the scroll range via bottom padding + clipToPadding=false the same way ScrollView does. ReactNestedScrollView itself is package-private, hence matching on the public androidx base class.
kirillzyusko
self-requested a review
July 2, 2026 16:15
Contributor
📊 Package size report
|
Nodonisko
marked this pull request as ready for review
July 2, 2026 16:22
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.
Problem
With React Native's
useNestedScrollViewAndroidfeature flag (RN 0.85+, react/react-native#55239),ScrollViewrenders asReactNestedScrollView, which extendsandroidx.core.widget.NestedScrollView(aFrameLayout) — notandroid.widget.ScrollView.ClippingScrollViewDecoratorView.findScrollViewonly matchesview is ScrollView, so it returns null,decorateScrollView()silently no-ops, andcontentInsetBottom/contentInsetTopare dropped entirely. In aKeyboardChatScrollViewthis means: list content hides behind the composer, andblankSpace/extraContentPaddinghave no effect on Android.Fix
Match
NestedScrollViewas well, and pass the found view around asViewGroup. Every member used by the decorator and the padding-scroll workaround (clipToPadding,getChildAt,setPadding,scrollBy,scrollY,canScrollVertically,getLocationOnScreen) lives onViewGroup/View, andNestedScrollViewextends its scroll range via bottom padding +clipToPadding = falseexactly likeScrollView.ReactNestedScrollViewitself is package-private, hence matching on the public androidx base class.Testing
Verified in a chat app (RN 0.85.3, new arch,
useNestedScrollViewAndroidenabled) via patch-package: composer inset, keyboard padding, andblankSpaceall apply again; behavior with the flag disabled (plainScrollView) is unchanged.🤖 Generated with Claude Code