diff --git a/packages/protolib/src/components/EditableObject/index.tsx b/packages/protolib/src/components/EditableObject/index.tsx index 60029eca7..cb84a6e1f 100644 --- a/packages/protolib/src/components/EditableObject/index.tsx +++ b/packages/protolib/src/components/EditableObject/index.tsx @@ -92,8 +92,8 @@ export const FormGroup = ({ ele, title, children, icon, simple = false, path }) } -export const GridElement = ({ index, data, width }) => { - const numColumns = data.ele._def.size || 1 +export const GridElement = ({ index, data, width, columns }) => { + const numColumns = data.ele._def.size <= columns ? data.ele._def.size : 1 return {getElement({ ele: data.ele, diff --git a/packages/protolib/src/components/Grid.tsx b/packages/protolib/src/components/Grid.tsx index 70fa8276d..9e161cb8c 100644 --- a/packages/protolib/src/components/Grid.tsx +++ b/packages/protolib/src/components/Grid.tsx @@ -134,7 +134,7 @@ export const Grid = React.forwardRef(({overScanBy=5,masonry=true, containerRef, return { data.map((ele, i) => { - return { React.createElement(card, {index: ele.index, data: {...ele}, width: itemMinWidth}) } + return { React.createElement(card, {index: ele.index, data: {...ele}, width: itemMinWidth, columns}) } }) } @@ -181,4 +181,4 @@ export const Grid = React.forwardRef(({overScanBy=5,masonry=true, containerRef, })} ) -}) +}) \ No newline at end of file