diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index 7dbcb788c3ac32..7dcecb4c3589a2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -394,6 +394,16 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) { */ @Override public void requestChildFocus(View child, View focused) { + /** + * This issue arises in a ScrollView containing a FlatList. The method now checks + * `mScrollEnabled` before handling focus requests to prevent unintended scroll behavior, + * ensuring proper functioning of nested scrolling components. when scrollEnabled={false} + */ + if (!mScrollEnabled) { + + return; + } + if (focused != null && !mPagingEnabled) { scrollToChild(focused); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index f66ed102018ab9..bec0fc5eef2329 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -343,6 +343,16 @@ protected void onDetachedFromWindow() { */ @Override public void requestChildFocus(View child, View focused) { + /** + * This issue arises in a ScrollView containing a FlatList. The method now checks + * `mScrollEnabled` before handling focus requests to prevent unintended scroll behavior, + * ensuring proper functioning of nested scrolling components. when scrollEnabled={false} + */ + if (!mScrollEnabled) { + + return; + } + if (focused != null) { scrollToChild(focused); }