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 } : {}), };