diff --git a/src/picker/picker-column.tsx b/src/picker/picker-column.tsx index 72db1a9..547b464 100644 --- a/src/picker/picker-column.tsx +++ b/src/picker/picker-column.tsx @@ -184,15 +184,17 @@ export class PickerColumn extends preact.Component { const distance = this.state.offset - this.momentumOffset; const duration = Date.now() - this.touchStartTime; const allowMomentum = duration < MOMENTUM_LIMIT_TIME && Math.abs(distance) > MOMENTUM_LIMIT_DISTANCE; - if (allowMomentum) { this.momentum(distance, duration); return; } - this.setState({ duration: DEFAULT_DURATION, }); + + // 划出边界处理 + const index = this.getIndexByOffset(this.state.offset); + this.setIndex(index); // compatible with desktop scenario // use setTimeout to skip the click event triggered after touchstart setTimeout(() => {