Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ const App = () => {
- ```overlayItemStyle?``` [object | array] - style for the overlay element in the center
- ```contentContainerStyle?``` [object | array] - style which wraps all of the child views [original](https://reactnative.dev/docs/scrollview#contentcontainerstyle)
- ```scrollEventThrottle?``` [object | array] - [original](https://reactnative.dev/docs/scrollview#scrolleventthrottle-ios)
- ```disableIntervalMomentum?``` [boolean] - When set to `true`, the scroll view stops on the next snap point relative to the release position instead of carrying through with momentum. Useful as an opt-in workaround for a [react-native bug](https://github.com/facebook/react-native/issues/29922) where some older Android OEM devices (e.g. vivo / Oppo) produce erratic snap behavior. Defaults to React Native's default (off).


#### usePickerItemHeight
Expand Down
3 changes: 3 additions & 0 deletions src/base/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export type ListProps<ItemT extends PickerItem<any>> = {
onScrollStart: (() => void) | undefined;
onScrollEnd: () => void;
contentContainerStyle: StyleProp<ViewStyle> | undefined;
disableIntervalMomentum?: boolean;
};

const List = <ItemT extends PickerItem<any>>(
Expand All @@ -60,6 +61,7 @@ const List = <ItemT extends PickerItem<any>>(
onScrollStart,
onScrollEnd,
contentContainerStyle: contentContainerStyleProp,
disableIntervalMomentum,
...restProps
}: ListProps<ItemT>,
forwardedRef: ForwardedRef<ListMethods>,
Expand Down Expand Up @@ -116,6 +118,7 @@ const List = <ItemT extends PickerItem<any>>(
onScroll={onScroll}
scrollOffset={scrollOffset}
snapToOffsets={snapToOffsets}
disableIntervalMomentum={disableIntervalMomentum}
style={styles.list}
contentContainerStyle={contentContainerStyle}
onTouchStart={onTouchStart}
Expand Down
1 change: 1 addition & 0 deletions src/base/picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type PickerProps<ItemT extends PickerItem<any>> = {
contentContainerStyle?: StyleProp<ViewStyle>;

scrollEventThrottle?: number;
disableIntervalMomentum?: boolean;

_enableSyncScrollAfterScrollEnd?: boolean;
_onScrollStart?: () => void;
Expand Down
4 changes: 4 additions & 0 deletions src/hoc/virtualized/VirtualizedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type VirtualizedListProps<ItemT extends PickerItem<any>> = {
onScrollStart: (() => void) | undefined;
onScrollEnd: () => void;
contentContainerStyle: StyleProp<ViewStyle> | undefined;
disableIntervalMomentum?: boolean;
} & AdditionalProps;

const VirtualizedList = <ItemT extends PickerItem<any>>(
Expand All @@ -74,6 +75,8 @@ const VirtualizedList = <ItemT extends PickerItem<any>>(
updateCellsBatchingPeriod = 10,
windowSize,

disableIntervalMomentum,

...restProps
}: VirtualizedListProps<ItemT>,
forwardedRef: ForwardedRef<ListMethods>,
Expand Down Expand Up @@ -123,6 +126,7 @@ const VirtualizedList = <ItemT extends PickerItem<any>>(
onScroll={onScroll}
scrollOffset={scrollOffset}
snapToOffsets={snapToOffsets}
disableIntervalMomentum={disableIntervalMomentum}
style={styles.list}
contentContainerStyle={contentContainerStyle}
onTouchStart={onTouchStart}
Expand Down
Loading