diff options
author | dan <dan.abramov@gmail.com> | 2024-11-13 21:13:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 21:13:07 +0000 |
commit | 4ca5267b98f0ef0b9a831f7e71ae05f9f138bbb2 (patch) | |
tree | 8ff126c62952f61832e78b184cb083d923ebd5d8 /src/view/com/util/List.tsx | |
parent | 3bab7f7540273a50501780b2f92076fbe41c8022 (diff) | |
download | voidsky-4ca5267b98f0ef0b9a831f7e71ae05f9f138bbb2.tar.zst |
[Lightbox] Small tweaks (#6301)
* Tweak lightbox springs * Speed up dismiss speed * Don't scroll to top while active lightbox * Make Android a bit faster
Diffstat (limited to 'src/view/com/util/List.tsx')
-rw-r--r-- | src/view/com/util/List.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/view/com/util/List.tsx b/src/view/com/util/List.tsx index 0425514e4..52314f954 100644 --- a/src/view/com/util/List.tsx +++ b/src/view/com/util/List.tsx @@ -8,6 +8,7 @@ import {useDedupe} from '#/lib/hooks/useDedupe' import {useScrollHandlers} from '#/lib/ScrollContext' import {addStyle} from '#/lib/styles' import {isIOS} from '#/platform/detection' +import {useLightbox} from '#/state/lightbox' import {useTheme} from '#/alf' import {FlatList_INTERNAL} from './Views' @@ -52,6 +53,7 @@ function ListImpl<ItemT>( const isScrolledDown = useSharedValue(false) const t = useTheme() const dedupe = useDedupe(400) + const {activeLightbox} = useLightbox() function handleScrolledDownChange(didScrollDown: boolean) { onScrolledDownChange?.(didScrollDown) @@ -143,6 +145,7 @@ function ListImpl<ItemT>( contentOffset={contentOffset} refreshControl={refreshControl} onScroll={scrollHandler} + scrollsToTop={!activeLightbox} scrollEventThrottle={1} onViewableItemsChanged={onViewableItemsChanged} viewabilityConfig={viewabilityConfig} |