forked from cybrespace/pinafore
fix: fix rounding of scroll math on Safari (#932)
This commit is contained in:
parent
9231e66612
commit
84e9bfc8e5
|
@ -189,7 +189,7 @@
|
||||||
onScroll () {
|
onScroll () {
|
||||||
let { length } = this.get()
|
let { length } = this.get()
|
||||||
let { scrollWidth, scrollLeft } = this.refs.scroller
|
let { scrollWidth, scrollLeft } = this.refs.scroller
|
||||||
let scrolledItem = Math.floor((scrollLeft / scrollWidth) * length)
|
let scrolledItem = Math.round((scrollLeft / scrollWidth) * length)
|
||||||
this.set({ scrolledItem })
|
this.set({ scrolledItem })
|
||||||
},
|
},
|
||||||
onClick (i) {
|
onClick (i) {
|
||||||
|
|
Loading…
Reference in New Issue