UNPKG

@salient-sys/react-native-infinite-picker

Version:

A simple, flexible, performant duration picker for React Native apps 🔥 Great for timers, alarms and duration inputs ⏰🕰️⏳ Includes iOS-style haptic and audio feedback 🍏

18 lines 614 B
export const getPickerItemAndIndexFromScrollOffset = variables => { const { disableInfiniteScroll, itemHeight, padWithNItems, pickerItems, yContentOffset } = variables; const index = Math.round(yContentOffset / itemHeight); const numberOfItems = pickerItems.length; const indexInInputList = (disableInfiniteScroll ? index : index + padWithNItems) % numberOfItems; const pickerItem = pickerItems === null || pickerItems === void 0 ? void 0 : pickerItems[indexInInputList]; return { pickerItem, index }; }; //# sourceMappingURL=getPickerItemAndIndexFromScrollOffset.js.map