fix(Picker): compatible with desktop scenario (#5430)

This commit is contained in:
neverland 2019-12-31 10:39:27 +08:00 committed by GitHub
parent a154e0683a
commit e8d01de060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,9 +140,14 @@ export default createComponent({
}
const index = this.getIndexByOffset(this.offset);
this.moving = false;
this.duration = DEFAULT_DURATION;
this.setIndex(index, true);
// compatible with desktop scenario
// use setTimeout to skip the click event triggered after touchstart
setTimeout(() => {
this.moving = false;
}, 0);
},
onTransitionEnd() {