Skip to content

Commit f55e943

Browse files
Merge pull request #941 from MenamAfzal/fix/padding-issue-on-container
Fix/padding issue on container
2 parents d115649 + 184c857 commit f55e943

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ export function GridItem(props: GridItemProps) {
441441
cssTransforms: true,
442442
}),
443443
style: {
444-
...setTransform(pos),
444+
...setTransform(pos,props.name),
445445
opacity: layoutHide ? 0 : undefined,
446446
pointerEvents: layoutHide ? "none" : "auto",
447447
},

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,18 +199,22 @@ export function getStatics(layout: Layout): Layout {
199199
return _.pickBy(layout, (l) => l.static);
200200
}
201201

202-
export function setTransform({ top, left, width, height }: Position): Record<string, any> {
202+
export function setTransform({ top, left, width, height }: Position,name?:string): Record<string, any> {
203203
// Replace unitless items with px
204204
const translate = `translate(${left}px,${top}px)`;
205+
function containsChart(str:string) {
206+
return /chart/i.test(str);
207+
}
208+
205209
return {
206210
transform: translate,
207211
WebkitTransform: translate,
208212
MozTransform: translate,
209213
msTransform: translate,
210214
OTransform: translate,
211215
width: `${width}px`,
212-
height: `${height}px`,
213-
position: "absolute",
216+
height: name ?containsChart(name)?`${height}px`:'auto':`${height}px`,
217+
position: 'absolute',
214218
};
215219
}
216220

0 commit comments

Comments
 (0)