Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

feat: Add scroll snapping for paging in #2548

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function InfiniteScrollListImpl<Item>(
renderItem,
extraData,
onViewableItemsChanged,
pagingEnabled,
viewabilityConfig,
ItemSeparatorComponent,
estimatedItemSize,
Expand Down Expand Up @@ -227,6 +228,7 @@ function InfiniteScrollListImpl<Item>(
flexGrow: 1,
//@ts-ignore
...style,
"scroll-snap-type": pagingEnabled ? "y mandatory" : undefined,
}
: {}
}
Expand Down Expand Up @@ -281,7 +283,12 @@ function InfiniteScrollListImpl<Item>(
key={virtualItem.key}
data-index={index}
ref={rowVirtualizer.measureElement}
style={{ width: "100%", ...transformStyle }}
style={{
width: "100%",
...transformStyle,
// @ts-ignore
"scroll-snap-align": pagingEnabled ? "start" : undefined,
}}
>
{typeof data?.[index] !== "undefined" ? (
<div
Expand Down
Loading