Skip to content

Commit

Permalink
fix(antd/next): fix gridSpan calculate algorithm (#1440)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokecy authored May 19, 2021
1 parent 48b7d05 commit 3b1f1cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/antd/src/form-grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ export const useGridSpan = (gridSpan = 1) => {
return gridSpan
} else {
if (isValid(maxColumns)) {
return Math.min(calc, columns, maxColumns)
return Math.min(calc, gridSpan, maxColumns)
}
return Math.min(calc, columns)
return Math.min(calc, gridSpan)
}
} else {
if (Math.min(calc, columns) >= gridSpan) {
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/form-grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ export const useGridSpan = (gridSpan = 1) => {
return gridSpan
} else {
if (isValid(maxColumns)) {
return Math.min(calc, columns, maxColumns)
return Math.min(calc, gridSpan, maxColumns)
}
return Math.min(calc, columns)
return Math.min(calc, gridSpan)
}
} else {
if (Math.min(calc, columns) >= gridSpan) {
Expand Down

0 comments on commit 3b1f1cf

Please sign in to comment.