Skip to content

Commit af3a8f4

Browse files
fix setting hide for comp doesn't hide it
1 parent 210c63c commit af3a8f4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function getLineStyle(
8989

9090
return `
9191
border: ${GRID_ITEM_BORDER_WIDTH}px ${borderStyle} ${borderColor};
92-
padding: ${isHidden && !isSelected ? 0 : padding[1] - GRID_ITEM_BORDER_WIDTH}px;
92+
padding: ${isHidden || !isSelected ? 0 : padding[1] - GRID_ITEM_BORDER_WIDTH}px;
9393
padding-left: ${padding[0] - GRID_ITEM_BORDER_WIDTH}px;
9494
padding-right: ${padding[0] - GRID_ITEM_BORDER_WIDTH}px;
9595
`;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ export function GridItem(props: GridItemProps) {
447447
pos,
448448
props.name,
449449
props.autoHeight,
450+
props.hidden,
450451
Boolean(draggingUtils.isDragging())
451452
),
452453
opacity: layoutHide ? 0 : undefined,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export function setTransform(
203203
{top, left, width, height }: Position,
204204
name ?: string,
205205
autoHeight?: boolean,
206+
hidden?: boolean,
206207
isDragging?: boolean,
207208
): Record<string, any> {
208209
// Replace unitless items with px
@@ -211,7 +212,7 @@ export function setTransform(
211212
return /chart/i.test(str);
212213
}
213214
let updatedHeight = 'auto';
214-
if (isDragging || !autoHeight || (name && containsChart(name))) {
215+
if (isDragging || !autoHeight || hidden || (name && containsChart(name))) {
215216
updatedHeight = `${height}px`;
216217
}
217218

0 commit comments

Comments
 (0)