fix: fix undefined error in media dialog scroll (#1048)

This commit is contained in:
Nolan Lawson 2019-02-26 22:18:24 -08:00 committed by GitHub
parent b7299f53fb
commit b0aa86ef44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,7 +266,11 @@
},
onScroll () {
let { length } = this.get()
let { scrollWidth, scrollLeft } = this.refs.scroller
let { scroller } = this.refs
if (!scroller) {
return
}
let { scrollWidth, scrollLeft } = scroller
let scrolledItem = Math.round((scrollLeft / scrollWidth) * length)
this.set({ scrolledItem })
},