mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
fix: prevent widgets from havin negative top position
This commit is contained in:
parent
d2bc60cdc0
commit
bc835e9dac
2 changed files with 11 additions and 0 deletions
|
|
@ -357,6 +357,9 @@ export const Container = ({
|
|||
const newWidth = (width * noOfGrids) / _canvasWidth;
|
||||
gw = gw ? gw : gridWidth;
|
||||
const parent = boxes[id]?.component?.parent;
|
||||
if (y < 0) {
|
||||
y = 0;
|
||||
}
|
||||
if (parent) {
|
||||
const parentElem = document.getElementById(`canvas-${parent}`);
|
||||
const parentId = parent.includes('-') ? parent?.split('-').slice(0, -1).join('-') : parent;
|
||||
|
|
@ -425,6 +428,10 @@ export const Container = ({
|
|||
}
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
y = 0;
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
const parentElem = document.getElementById(`canvas-${parent}`);
|
||||
const parentId = parent.includes('-') ? parent?.split('-').slice(0, -1).join('-') : parent;
|
||||
|
|
|
|||
|
|
@ -772,6 +772,10 @@ export default function DragContainer({
|
|||
width,
|
||||
} = lastEvent;
|
||||
|
||||
if (top < 0) {
|
||||
top = 0;
|
||||
}
|
||||
|
||||
let draggedOverElemId = i.parent;
|
||||
const parentComponent = boxes.find((box) => box.id === i.parent);
|
||||
const parentComponentType = parentComponent?.component?.component;
|
||||
|
|
|
|||
Loading…
Reference in a new issue