Skip to content

Commit

Permalink
fix: Adjust mobile itemSize for virtual scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
hayden-fr committed Nov 2, 2024
1 parent 274a598 commit 599ac92
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/DialogManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<ResponseScroll
:items="list"
:itemSize="cardWidth / aspect + gutter"
:itemSize="itemSize"
:row-key="(item) => item.map(genModelKey).join(',')"
class="h-full flex-1"
>
Expand Down Expand Up @@ -120,6 +120,17 @@ const sortOrderOptions = ref(
}),
)
const itemSize = computed(() => {
let itemWidth = cardWidth
let itemGutter = gutter
if (isMobile.value) {
const baseSize = 16
itemWidth = window.innerWidth - baseSize * 2 * 2
itemGutter = baseSize * 2
}
return itemWidth / aspect + itemGutter
})
const colSpan = ref(1)
const colSpanWidth = ref(cardWidth)
Expand Down

0 comments on commit 599ac92

Please sign in to comment.