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
1 changed files with 1 additions and 1 deletions

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) {