fix: component default width calc corrected

This commit is contained in:
Johnson Cherian 2023-12-18 18:34:25 +05:30
parent ea414c2c5b
commit ff56496c9f
2 changed files with 2 additions and 4 deletions

View file

@ -29,7 +29,7 @@ export const BoxDragPreview = memo(function BoxDragPreview({ item, canvasWidth }
return (
<div
className="resizer-active draggable-box"
style={{ height, width: (width * canvasWidth) / 24, border: 'solid 1px rgb(70, 165, 253)', padding: '2px' }}
style={{ height, width: (width * canvasWidth) / 43, border: 'solid 1px rgb(70, 165, 253)', padding: '2px' }}
>
<div
style={{

View file

@ -1634,9 +1634,7 @@ export const addNewWidgetToTheEditor = (
const componentData = _.cloneDeep(componentMetaData);
const noOfGrid = useGridStore.getState().noOfGrid;
const defaultWidth = isInSubContainer
? (componentMetaData.defaultSize.width * 100) / noOfGrid
: componentMetaData.defaultSize.width;
const defaultWidth = componentMetaData.defaultSize.width;
const defaultHeight = componentMetaData.defaultSize.height;
componentData.name = computeComponentName(componentData.component, currentComponents);