@quidone/react-native-wheel-picker
Version:
Picker is a UI component for selecting an item from a list of options.
18 lines (17 loc) • 430 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPageIndex = void 0;
const getPageIndex = (offset, _ref) => {
let {
maxIndex,
pageLength
} = _ref;
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