diff --git a/src/PickerMixin.tsx b/src/PickerMixin.tsx index 04a9c3d..609df4a 100644 --- a/src/PickerMixin.tsx +++ b/src/PickerMixin.tsx @@ -32,13 +32,7 @@ export default function(ComposedComponent) { } coumputeChildIndex(top, itemHeight, childrenLength) { - let index = top / itemHeight; - const floor = Math.floor(index); - if (index - floor > 0.5) { - index = floor + 1; - } else { - index = floor; - } + const index = Math.round(top / itemHeight); return Math.min(index, childrenLength - 1); }