diff --git a/packages/antd/src/form-grid/index.tsx b/packages/antd/src/form-grid/index.tsx index a5e598c6c36..506407a010b 100644 --- a/packages/antd/src/form-grid/index.tsx +++ b/packages/antd/src/form-grid/index.tsx @@ -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) { diff --git a/packages/next/src/form-grid/index.tsx b/packages/next/src/form-grid/index.tsx index a5e598c6c36..506407a010b 100644 --- a/packages/next/src/form-grid/index.tsx +++ b/packages/next/src/form-grid/index.tsx @@ -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) {