Skip to content

Commit 080c631

Browse files
maintain comp height on dragging
1 parent 892fe07 commit 080c631

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

client/packages/lowcoder/src/layout/gridItem.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,12 @@ export function GridItem(props: GridItemProps) {
441441
cssTransforms: true,
442442
}),
443443
style: {
444-
...setTransform(pos, props.name, props.autoHeight),
444+
...setTransform(
445+
pos,
446+
props.name,
447+
props.autoHeight,
448+
Boolean(draggingUtils.isDragging())
449+
),
445450
opacity: layoutHide ? 0 : undefined,
446451
pointerEvents: layoutHide ? "none" : "auto",
447452
},

client/packages/lowcoder/src/layout/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@ export function setTransform(
203203
{top, left, width, height }: Position,
204204
name ?: string,
205205
autoHeight?: boolean,
206+
isDragging?: boolean,
206207
): Record<string, any> {
207208
// Replace unitless items with px
208209
const translate = `translate(${left}px,${top}px)`;
209210
function containsChart(str:string) {
210211
return /chart/i.test(str);
211212
}
212-
213213
let updatedHeight = 'auto';
214-
if (!autoHeight || (name && containsChart(name))) {
214+
if (isDragging || !autoHeight || (name && containsChart(name))) {
215215
updatedHeight = `${height}px`;
216216
}
217217

0 commit comments

Comments
 (0)