@quidone/react-native-wheel-picker
Version:
Picker is a UI component for selecting an item from a list of options.
17 lines (16 loc) • 405 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPageIndex = void 0;
const getPageIndex = (offset, {
maxIndex,
pageLength
}) => {
let index = Math.floor((offset + pageLength / 2) / pageLength);
index = Math.max(0, index);
index = Math.min(index, maxIndex);
return index;
};
exports.getPageIndex = getPageIndex;
//# sourceMappingURL=getPageIndex.js.map