Skip to content

Commit

Permalink
fix(VirtualList): fix scroll bar size, close alibaba-fusion#3600 (ali…
Browse files Browse the repository at this point in the history
  • Loading branch information
youluna authored Dec 14, 2021
1 parent 45eae2a commit 7e8d119
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/virtual-list/virtual-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ class VirtualList extends Component {
return itemSizeGetter(index);
}

const height = Object.keys(this.cache)
.map(key => this.cache[key])
.pop();
if (!this.defaultItemHeight && jumpIndex > -1 && height) {
if (!this.defaultItemHeight && jumpIndex > -1) {
const keysList = Object.keys(this.cache);
const len = keysList.length;
const height = this.cache[len - 1];
this.defaultItemHeight = height;
}

Expand Down Expand Up @@ -402,7 +402,7 @@ class VirtualList extends Component {

const style = { position: 'relative' };

const size = this.getSpaceBefore(length, this.cacheAdd);
const size = this.getSpaceBefore(length, {});

if (size) {
style.height = size;
Expand Down

0 comments on commit 7e8d119

Please sign in to comment.