Skip to content

Commit 91b470f

Browse files
fix layers zIndex issue
1 parent 18959b9 commit 91b470f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/packages/lowcoder/src/comps/utils/gridCompOperator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export class GridCompOperator {
173173
this.doDelete(editorState, compRecords) &&
174174
messageInstance.info(trans("gridCompOperator.deleteCompsSuccess", { undoKey }));
175175
};
176+
176177
if (compNum > 1) {
177178
CustomModal.confirm({
178179
title: trans("gridCompOperator.deleteCompsTitle"),

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ class GridLayout extends React.Component<GridLayoutProps, GridLayoutState> {
10031003

10041004
// log.debug("GridLayout render. layout: ", layout, " oriLayout: ", this.state.layout, " extraLayout: ", this.props.extraLayout);
10051005
const layouts = Object.values(layout);
1006+
const maxLayoutPos = Math.max(...layouts.map(l => l.pos || 0))
10061007
return (
10071008
<LayoutContainer
10081009
ref={this.ref}
@@ -1027,10 +1028,10 @@ class GridLayout extends React.Component<GridLayoutProps, GridLayoutState> {
10271028
>
10281029
<div style={contentStyle}>
10291030
{showGridLines && this.gridLines()}
1030-
{mounted &&
1031+
{mounted &&
10311032
layouts.map((item) => {
10321033
const zIndex = item.pos !== undefined
1033-
? layouts.length - item.pos
1034+
? (maxLayoutPos - item.pos) + 1
10341035
: 1;
10351036
return this.processGridItem(zIndex, item, childrenMap)
10361037
})

0 commit comments

Comments
 (0)