From 8bc0318e10def96ed1aad14fad978d7b145378dc Mon Sep 17 00:00:00 2001 From: Johnson Cherian Date: Tue, 12 Mar 2024 10:21:34 +0530 Subject: [PATCH] fix: roundback width to max parent with --- frontend/src/Editor/SubContainer.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Editor/SubContainer.jsx b/frontend/src/Editor/SubContainer.jsx index 4a8c840db6..ebebcf13b6 100644 --- a/frontend/src/Editor/SubContainer.jsx +++ b/frontend/src/Editor/SubContainer.jsx @@ -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 } : {}), };