Skip to content

Commit 95bac85

Browse files
Abbondanzometa-codesync[bot]
authored andcommitted
Always enable nested scrolling for swipe refresh layouts (#55189)
Summary: Pull Request resolved: #55189 If nested scrolling is not enabled by default for ScrollView that define a `RefreshControl`, the wrapping Android view `ReactSwipeRefreshLayout` will swallow and discard non-touch scroll actions, like joystick movements. This change updates the default to be true, a more-sane default, which aligns with the existing touch actions that are always allowed. This does not impact touch-based behavior at all. Changelog: [Android][Changed] Updated the `nestedScrollEnabled` prop to default to true if the ScrollView defines a `refreshControl` Reviewed By: javache Differential Revision: D90778643 fbshipit-source-id: 37693e80fc7c8b3461dc3d5cad51690e0ff77a77
1 parent 0649717 commit 95bac85

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • packages/react-native/Libraries/Components/ScrollView

packages/react-native/Libraries/Components/ScrollView/ScrollView.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,8 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
18501850
{style: StyleSheet.compose(baseStyle, outer)},
18511851
<NativeScrollView
18521852
{...props}
1853+
// Nested scroll should always be enabled to allow the child scroll view to handle events before passing them to the refresh control parent
1854+
nestedScrollEnabled={props.nestedScrollEnabled ?? true}
18531855
style={StyleSheet.compose(baseStyle, inner)}
18541856
// $FlowFixMe[incompatible-type] - Flow only knows element refs.
18551857
ref={scrollViewRef}>

0 commit comments

Comments
 (0)