Skip to content

Commit

Permalink
fix(FilePicker): Only show checkbox skeletons if multiselect was enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Aug 28, 2023
1 parent ada8f23 commit 2f9db1d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/components/FilePicker/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</thead>
<tbody>
<template v-if="loading">
<LoadingTableRow v-for="i in [1, 2, 3, 4]" :key="i" />
<LoadingTableRow v-for="i in [1, 2, 3, 4]" :key="i" :show-checkbox="multiselect"/>
</template>
<template v-else>
<FileListRow v-for="file in sortedFiles"
Expand Down
11 changes: 10 additions & 1 deletion lib/components/FilePicker/LoadingTableRow.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Simple component to fake a loading table row with placeholders -->
<template>
<tr aria-hidden="true" class="file-picker__row loading-row">
<td class="row-checkbox">
<td v-if="showCheckbox" class="row-checkbox">
<span />
</td>
<td class="row-name">
Expand All @@ -16,6 +16,15 @@
</tr>
</template>

<script setup lang="ts">
defineProps<{
/**
* Does the filelist use the checkbox column
*/
showCheckbox: boolean
}>()
</script>

<style scoped lang="scss">
@use './FileList.scss';
Expand Down

0 comments on commit 2f9db1d

Please sign in to comment.