|
1 | 1 | import React, { useEffect, useMemo, useState } from 'react'; |
2 | | -import { NativeScrollEvent, NativeSyntheticEvent, StyleSheet, View } from 'react-native'; |
| 2 | +import { type NativeScrollEvent, type NativeSyntheticEvent, StyleSheet, View } from 'react-native'; |
3 | 3 | import { FlashList } from '@shopify/flash-list'; |
4 | 4 |
|
5 | | -import { IListProps } from '../definitions'; |
6 | | -import { isIOS } from '../../../../lib/methods/helpers'; |
7 | | -import scrollPersistTaps from '../../../../lib/methods/helpers/scrollPersistTaps'; |
8 | | -import NavBottomFAB from './NavBottomFAB'; |
9 | 5 | import { type IListProps } from '../definitions'; |
| 6 | +import NavBottomFAB from './NavBottomFAB'; |
10 | 7 | import { SCROLL_LIMIT } from '../constants'; |
11 | 8 | import { useRoomContext } from '../../context'; |
12 | | -import { SCROLL_LIMIT } from '../constants'; |
13 | | -import NavBottomFAB from './NavBottomFAB'; |
14 | 9 |
|
15 | 10 | const styles = StyleSheet.create({ |
16 | 11 | list: { |
@@ -47,18 +42,9 @@ const List = ({ listRef, jumpToBottom, ...props }: IListProps) => { |
47 | 42 | } |
48 | 43 | }; |
49 | 44 |
|
50 | | - useEffect(() => { |
51 | | - if (!userScrolled) { |
52 | | - setTimeout(() => { |
53 | | - listRef?.current.scrollToEnd(); |
54 | | - }, 200); |
55 | | - } |
56 | | - }, [props.data?.length]); |
57 | | - |
58 | 45 | return ( |
59 | 46 | <View style={styles.list}> |
60 | 47 | <FlashList |
61 | | - onMomentumScrollBegin={() => setUserScrolled(true)} |
62 | 48 | ref={listRef} |
63 | 49 | accessibilityElementsHidden={isAutocompleteVisible} |
64 | 50 | importantForAccessibility={isAutocompleteVisible ? 'no-hide-descendants' : 'yes'} |
|
0 commit comments