Skip to content

Commit

Permalink
fix(RecycleScroller): gridItems is undefined when scrollToItem, fix #773
Browse files Browse the repository at this point in the history
 (#761)
  • Loading branch information
crs38c28 authored Dec 14, 2022
1 parent bd51403 commit 7c809ad
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,11 @@ export default {
scrollToItem (index) {
let scroll
const gridItems = this.gridItems || 1
if (this.itemSize === null) {
scroll = index > 0 ? this.sizes[index - 1].accumulator : 0
} else {
scroll = Math.floor(index / this.gridItems) * this.itemSize
scroll = Math.floor(index / gridItems) * this.itemSize
}
this.scrollToPosition(scroll)
},
Expand Down

0 comments on commit 7c809ad

Please sign in to comment.