Skip to content

Commit

Permalink
ref(useDynamicGrid.ts): use isMobileVariant
Browse files Browse the repository at this point in the history
  • Loading branch information
hassnian committed Jun 6, 2024
1 parent b78ce15 commit 4985bdc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions composables/useDynamicGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export default ({
}: UseDynamicGridParams) => {
const containerWidth = ref(0)

const isMobile = computed(() => containerWidth.value <= 768)
const isMobileVariant = computed(() => mobileVariant && isMobile.value)
const isMobileVariant = computed(
() => mobileVariant && containerWidth.value <= 768,
)

const getColsFilledByAllRows = (cols: number): number => {
if (!fillRows?.value || cols === 1) {
Expand All @@ -44,7 +45,7 @@ export default ({

if (fillRows) {
const filledCols = getColsFilledByAllRows(getCols)
return filledCols === 1 && !isMobile.value ? getCols : filledCols
return filledCols === 1 && !isMobileVariant.value ? getCols : filledCols
}

return getCols
Expand Down

0 comments on commit 4985bdc

Please sign in to comment.