Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent scroll event in nested scroll when scrollEnabled={false} (#42219
) Summary: When a FlatList is in side a scroll view (think Netflix style navigation), the DPAD up/down fires on the scroll view, despite scrollEnabled={false} being set. This additiontially conflicts with any custom scroll event that has been created. ## Changelog: [Android] [Fixed] - fix: prevent scroll event in nested scroll when scrollEnabled={false} Pull Request resolved: #42219 Test Plan: I tested this by making a ScrollView with FlatList of opposite scrolling direction inside with basic card layouts. Both had scrollEnabled={false} I scrolled the ScrollView myself as it has multiple rows using: ``` const scrollToItem = React.useCallback( (itemIndex: number): void => { const targetScrollY = itemIndex * height scrollViewRef.current?.scrollTo({ y: targetScrollY, animated: true }) }, [height] ) React.useEffect(() => { // Row 0, is global nav, but it's also the first row of cards // when we scroll to "1" what we mean is global nav is hidden // we should still be showing the first row of items. scrollToItem(rowIndex <= 1 ? 0 : rowIndex - 1) }, [rowIndex, scrollToItem]) ``` Reviewed By: NickGerleman Differential Revision: D52642168 Pulled By: mdvacca fbshipit-source-id: 9305bc56ba6b03b04b9f69a14d433593cab2025e
- Loading branch information