Skip to content

Commit 30f5a70

Browse files
Abbondanzofacebook-github-bot
authored andcommitted
Always enable nested scrolling for swipe refresh layouts (react#55189)
Summary: 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` Differential Revision: D90778643
1 parent 60f9bfd commit 30f5a70

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)