From f11bea9e3d8dbe9aa0bc7f7d9d4960b606c6883d Mon Sep 17 00:00:00 2001 From: Nakul Nagargade Date: Fri, 21 Mar 2025 01:44:42 +0530 Subject: [PATCH] fix --- .../RightSideBar/ComponentsManagerTab/DragLayer.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/AppBuilder/RightSideBar/ComponentsManagerTab/DragLayer.jsx b/frontend/src/AppBuilder/RightSideBar/ComponentsManagerTab/DragLayer.jsx index 158d87787d..9589ac145b 100644 --- a/frontend/src/AppBuilder/RightSideBar/ComponentsManagerTab/DragLayer.jsx +++ b/frontend/src/AppBuilder/RightSideBar/ComponentsManagerTab/DragLayer.jsx @@ -44,11 +44,16 @@ const CustomDragLayer = ({ size }) => { const mainCanvasWidth = document.getElementById('real-canvas')?.offsetWidth || 0; - const width = (mainCanvasWidth * size.width) / NO_OF_GRIDS; + let width = (mainCanvasWidth * size.width) / NO_OF_GRIDS; // Calculate position relative to the current canvas (parent or child) const left = currentOffset.x - (canvasBounds?.left || 0); const top = currentOffset.y - (canvasBounds?.top || 0); + // Adjust position and width if exceeding grid bounds + if (width >= canvasWidth) { + width = canvasWidth; + } + const [x, y] = snapToGrid(canvasWidth, left, top); return (