mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
fix
This commit is contained in:
parent
4b3f0ed65d
commit
f11bea9e3d
1 changed files with 6 additions and 1 deletions
|
|
@ -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 (
|
||||
<div
|
||||
|
|
|
|||
Loading…
Reference in a new issue