mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Always enable nested scrolling for swipe refresh layouts (#55189)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
1 parent
0649717a3d
commit
95bac85b5a
1 file changed
+2
@@ -1850,6 +1850,8 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
|
||||
{style: StyleSheet.compose(baseStyle, outer)},
|
||||
<NativeScrollView
|
||||
{...props}
|
||||
// Nested scroll should always be enabled to allow the child scroll view to handle events before passing them to the refresh control parent
|
||||
nestedScrollEnabled={props.nestedScrollEnabled ?? true}
|
||||
style={StyleSheet.compose(baseStyle, inner)}
|
||||
// $FlowFixMe[incompatible-type] - Flow only knows element refs.
|
||||
ref={scrollViewRef}>
|
||||
|
||||
Reference in new issue
Block a user