diff options
author | dan <dan.abramov@gmail.com> | 2023-11-10 19:00:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 19:00:46 +0000 |
commit | 65def371659c3b64481199b2585a40a1affd9ec2 (patch) | |
tree | 1fb92b4717fcfc82bdd476fdbcaa4ea80cb673bb /src/view/screens/SearchMobile.tsx | |
parent | e0e5bc8fd850942b6749ad48d9ae087d99026996 (diff) | |
download | voidsky-65def371659c3b64481199b2585a40a1affd9ec2.tar.zst |
Push useAnimatedScrollHandler down everywhere to work around bugs (#1866)
* Move useOnMainScroll handlers to leaves * Force Feed to always take handlers * Pass handlers from the pager
Diffstat (limited to 'src/view/screens/SearchMobile.tsx')
-rw-r--r-- | src/view/screens/SearchMobile.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/view/screens/SearchMobile.tsx b/src/view/screens/SearchMobile.tsx index c1df58ffd..92c255d5b 100644 --- a/src/view/screens/SearchMobile.tsx +++ b/src/view/screens/SearchMobile.tsx @@ -14,6 +14,7 @@ import { } from 'lib/routes/types' import {observer} from 'mobx-react-lite' import {Text} from 'view/com/util/text/Text' +import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED' import {useStores} from 'state/index' import {UserAutocompleteModel} from 'state/models/discovery/user-autocomplete' import {SearchUIModel} from 'state/models/ui/search' @@ -131,6 +132,7 @@ export const SearchScreen = withAuthRequired( } }, []) + const scrollHandler = useAnimatedScrollHandler(onMainScroll) return ( <TouchableWithoutFeedback onPress={onPress} accessible={false}> <View style={[pal.view, styles.container]}> @@ -156,8 +158,8 @@ export const SearchScreen = withAuthRequired( ref={scrollViewRef} testID="searchScrollView" style={pal.view} - onScroll={onMainScroll} - scrollEventThrottle={100}> + onScroll={scrollHandler} + scrollEventThrottle={1}> {query && autocompleteView.suggestions.length ? ( <> {autocompleteView.suggestions.map((suggestion, index) => ( |