Skip to content

Commit b0429b2

Browse files
committed
fix: Prevent invalid range for skeleton number
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent c687a9b commit b0429b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/components/FilePicker/FileList.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<LoadingTableRow v-for="index in skeletonNumber" :key="index" :show-checkbox="multiselect" />
6161
</template>
6262
<template v-else>
63-
<FileListRow v-for="file in sortedFiles"
63+
<FileListRow v-for="file of sortedFiles"
6464
:key="file.fileid || file.path"
6565
:allow-pick-directory="allowPickDirectory"
6666
:show-checkbox="multiselect"
@@ -212,7 +212,7 @@ const fileContainer = ref<HTMLDivElement>()
212212
}
213213
}
214214
// container height - 50px table header / row height of 50px
215-
skeletonNumber.value = Math.floor((height - 50) / 50)
215+
skeletonNumber.value = Math.max(1, Math.floor((height - 50) / 50))
216216
})
217217
onMounted(() => {
218218
window.addEventListener('resize', resize)

0 commit comments

Comments
 (0)