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

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 })
},