Skip to content

Commit

Permalink
Fix scrollToItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jun 27, 2017
1 parent 6408d57 commit e2384fc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/vue-virtual-scroller.js

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions docs/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/build.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-virtual-scroller",
"description": "Smooth scrolling for any amount of data",
"version": "0.7.0",
"version": "0.7.1",
"author": {
"name": "Guillaume Chau",
"email": "[email protected]"
Expand Down
5 changes: 1 addition & 4 deletions src/components/VirtualScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ export default {
scrollToItem (index) {
let scrollTop
if (this.itemHeight === null) {
scrollTop = 0
for (let i = 0; i < index; i++) {
scrollTop += this.items[i][this.heightField]
}
scrollTop = index > 0 ? this.heights[index - 1] : 0
} else {
scrollTop = index * this.itemHeight
}
Expand Down

0 comments on commit e2384fc

Please sign in to comment.