fix: fix rounding of scroll math on Safari (#932)

This commit is contained in:
Nolan Lawson 2019-02-03 11:10:58 -08:00 committed by GitHub
parent 9231e66612
commit 84e9bfc8e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -189,7 +189,7 @@
onScroll () {
let { length } = this.get()
let { scrollWidth, scrollLeft } = this.refs.scroller
let scrolledItem = Math.floor((scrollLeft / scrollWidth) * length)
let scrolledItem = Math.round((scrollLeft / scrollWidth) * length)
this.set({ scrolledItem })
},
onClick (i) {