Skip to content

Commit

Permalink
fix(grid): fix calcSatisfyColumns
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Oct 21, 2021
1 parent 9e468fa commit 04dead3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/grid/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ const calcSatisfyColumns = (
if (columnWidth >= minWidth && columnWidth <= maxWidth) {
results.push(columns)
} else if (columnWidth < minWidth) {
results.push(Math.floor(innerWidth / minWidth))
results.push(Math.min(Math.floor(innerWidth / minWidth), maxColumns))
} else if (columnWidth > maxWidth) {
results.push(Math.floor(innerWidth / maxWidth))
results.push(Math.min(Math.floor(innerWidth / maxWidth), maxColumns))
}
}
return Math.max(...results)
Expand Down

0 comments on commit 04dead3

Please sign in to comment.