fix: roundback width to max parent with

This commit is contained in:
Johnson Cherian 2024-03-12 10:21:34 +05:30
parent 9db3039264
commit 8bc0318e10

View file

@ -885,12 +885,12 @@ const SubWidgetWrapper = ({
const isDragging = useGridStore((state) => state?.draggingComponentId === id);
const width = (canvasWidth * layoutData.width) / 43;
let width = (canvasWidth * layoutData.width) / 43;
width = width > canvasWidth ? canvasWidth : width; //this handles scenarios where the width is set more than canvas for older components
const styles = {
width: width + 'px',
height: layoutData.height + 'px',
transform: `translate(${layoutData.left * gridWidth}px, ${layoutData.top}px)`,
// ...(isGhostComponent ? { opacity: 0.5 } : isResizing ? { opacity: 0 } : {}),
...(isGhostComponent ? { opacity: 0.5 } : {}),
};