Skip to content

Commit

Permalink
Merge pull request #43810 from Krishna2323/krishna2323/issue/42577
Browse files Browse the repository at this point in the history
fix: Distance - Page is not scrollable after adding multiple stops.
  • Loading branch information
stitesExpensify authored Jul 30, 2024
2 parents d2fdb27 + c04d00b commit 0928292
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/components/DraggableList/index.android.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import React from 'react';
import {View} from 'react-native';
import DraggableFlatList from 'react-native-draggable-flatlist';
import type {FlatList} from 'react-native-gesture-handler';
import {NestableDraggableFlatList, NestableScrollContainer} from 'react-native-draggable-flatlist';
import type {ScrollView} from 'react-native-gesture-handler';
import useThemeStyles from '@hooks/useThemeStyles';
import type {DraggableListProps} from './types';

function DraggableList<T>({renderClone, shouldUsePortal, ListFooterComponent, ...viewProps}: DraggableListProps<T>, ref: React.ForwardedRef<FlatList<T>>) {
function DraggableList<T>({renderClone, shouldUsePortal, ListFooterComponent, ...viewProps}: DraggableListProps<T>, ref: React.ForwardedRef<ScrollView>) {
const styles = useThemeStyles();
return (
<View style={styles.flex1}>
<DraggableFlatList
ref={ref}
containerStyle={ListFooterComponent ? undefined : styles.flex1}
contentContainerStyle={ListFooterComponent ? undefined : styles.flexGrow1}
<NestableScrollContainer
ref={ref}
contentContainerStyle={styles.flexGrow1}
>
<NestableDraggableFlatList
contentContainerStyle={styles.flex1}
// eslint-disable-next-line react/jsx-props-no-spreading
{...viewProps}
/>
{React.isValidElement(ListFooterComponent) && <View style={styles.flexGrow1}>{ListFooterComponent}</View>}
</View>
</NestableScrollContainer>
);
}

Expand Down

0 comments on commit 0928292

Please sign in to comment.