Skip to content

Commit

Permalink
Merge pull request #33343 from margelo/perunt/bidirectional-list-load…
Browse files Browse the repository at this point in the history
…er-mobile-fix

Chat `onStartReached` loader fix
  • Loading branch information
thienlnam authored Jan 4, 2024
2 parents d569d32 + 6247ae8 commit 5b0ceb2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions src/components/InvertedFlatList/index.native.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import type {ForwardedRef} from 'react';
import React, {forwardRef} from 'react';
import type {FlatList, FlatListProps} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import BaseInvertedFlatList from './BaseInvertedFlatList';
import CellRendererComponent from './CellRendererComponent';

function BaseInvertedFlatListWithRef<T>(props: FlatListProps<T>, ref: ForwardedRef<FlatList>) {
const styles = useThemeStyles();
return (
<BaseInvertedFlatList
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={ref}
contentContainerStyle={styles.justifyContentEnd}
CellRendererComponent={CellRendererComponent}
/**
* To achieve absolute positioning and handle overflows for list items, the property must be disabled
Expand Down
3 changes: 1 addition & 2 deletions src/components/InvertedFlatList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BaseInvertedFlatList from './BaseInvertedFlatList';

// This is adapted from https://codesandbox.io/s/react-native-dsyse
// It's a HACK alert since FlatList has inverted scrolling on web
function InvertedFlatList<T>({onScroll: onScrollProp = () => {}, contentContainerStyle, ...props}: FlatListProps<T>, ref: ForwardedRef<FlatList>) {
function InvertedFlatList<T>({onScroll: onScrollProp = () => {}, ...props}: FlatListProps<T>, ref: ForwardedRef<FlatList>) {
const lastScrollEvent = useRef<number | null>(null);
const scrollEndTimeout = useRef<NodeJS.Timeout | null>(null);
const updateInProgress = useRef<boolean>(false);
Expand Down Expand Up @@ -86,7 +86,6 @@ function InvertedFlatList<T>({onScroll: onScrollProp = () => {}, contentContaine
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={ref}
contentContainerStyle={contentContainerStyle}
onScroll={handleScroll}
/>
);
Expand Down
1 change: 0 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,6 @@ const styles = (theme: ThemeColors) =>
},

chatContentScrollView: {
flexGrow: 1,
justifyContent: 'flex-end',
paddingBottom: 16,
},
Expand Down

0 comments on commit 5b0ceb2

Please sign in to comment.