From cd7063e7d4844d4b770c916f4ae6e88fbd4efa49 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 17 Oct 2022 10:22:41 +0200 Subject: [PATCH] fix: height NaN, fix #757 --- .../src/components/RecycleScroller.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/vue-virtual-scroller/src/components/RecycleScroller.vue b/packages/vue-virtual-scroller/src/components/RecycleScroller.vue index 46b23a56..247af334 100644 --- a/packages/vue-virtual-scroller/src/components/RecycleScroller.vue +++ b/packages/vue-virtual-scroller/src/components/RecycleScroller.vue @@ -355,7 +355,7 @@ export default { updateVisibleItems (checkItem, checkPositionDiff = false) { const itemSize = this.itemSize - const gridItems = this.gridItems + const gridItems = this.gridItems || 1 const itemSecondarySize = this.itemSecondarySize || itemSize const minItemSize = this.$_computedMinItemSize const typeField = this.typeField @@ -654,9 +654,11 @@ export default { addListeners () { this.listenerTarget = this.getListenerTarget() - this.listenerTarget.addEventListener('scroll', this.handleScroll, supportsPassive ? { - passive: true, - } : false) + this.listenerTarget.addEventListener('scroll', this.handleScroll, supportsPassive + ? { + passive: true, + } + : false) this.listenerTarget.addEventListener('resize', this.handleResize) },