Skip to content

Commit e8bc881

Browse files
committed
[Fix]: #1290 add zindex property for stacking issue
1 parent 0e5aa97 commit e8bc881

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

client/packages/lowcoder/src/comps/hooks/drawerComp.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ContainerCompBuilder } from "comps/comps/containerBase/containerCompBui
44
import { gridItemCompToGridItems, InnerGrid } from "comps/comps/containerComp/containerView";
55
import { AutoHeightControl } from "comps/controls/autoHeightControl";
66
import { BoolControl } from "comps/controls/boolControl";
7-
import { StringControl } from "comps/controls/codeControl";
7+
import { StringControl, NumberControl } from "comps/controls/codeControl";
88
import { booleanExposingStateControl } from "comps/controls/codeStateControl";
99
import { PositionControl, LeftRightControl, HorizontalAlignmentControl } from "comps/controls/dropdownControl";
1010
import { eventHandlerControl } from "comps/controls/eventHandlerControl";
@@ -122,6 +122,7 @@ const childrenMap = {
122122
showMask: withDefault(BoolControl, true),
123123
toggleClose:withDefault(BoolControl,true),
124124
escapeClosable: withDefault(BoolControl, true),
125+
zIndex: withDefault(NumberControl, Layers.drawer),
125126
};
126127

127128
type ChildrenType = NewChildren<RecordConstructorToComp<typeof childrenMap>> & {
@@ -168,6 +169,9 @@ const DrawerPropertyView = React.memo((props: {
168169
{props.children.escapeClosable.propertyView({
169170
label: trans("prop.escapeClose"),
170171
})}
172+
{props.children.zIndex.propertyView({
173+
label: trans("prop.zIndex"),
174+
})}
171175
</Section>
172176
<Section name={sectionNames.interaction}>{props.children.onEvent.getPropertyView()}</Section>
173177
<Section name={sectionNames.style}>{props.children.style.getPropertyView()}</Section>
@@ -251,7 +255,7 @@ const DrawerView = React.memo((
251255
height={!props.autoHeight ? transToPxSize(props.height || DEFAULT_SIZE) : ""}
252256
onClose={onClose}
253257
afterOpenChange={afterOpenChange}
254-
zIndex={Layers.drawer}
258+
zIndex={props.zIndex}
255259
maskClosable={props.maskClosable}
256260
mask={true}
257261
className={clsx(`app-${appID}`, props.className)}

client/packages/lowcoder/src/comps/hooks/modalComp.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ContainerCompBuilder } from "comps/comps/containerBase/containerCompBuilder";
22
import { gridItemCompToGridItems, InnerGrid } from "comps/comps/containerComp/containerView";
33
import { AutoHeightControl } from "comps/controls/autoHeightControl";
4-
import { StringControl } from "comps/controls/codeControl";
4+
import { StringControl, NumberControl } from "comps/controls/codeControl";
55
import { booleanExposingStateControl } from "comps/controls/codeStateControl";
66
import { eventHandlerControl } from "comps/controls/eventHandlerControl";
77
import { styleControl } from "comps/controls/styleControl";
@@ -117,7 +117,8 @@ const childrenMap = {
117117
style: styleControl(ModalStyle),
118118
maskClosable: withDefault(BoolControl, true),
119119
showMask: withDefault(BoolControl, true),
120-
toggleClose:withDefault(BoolControl,true)
120+
toggleClose:withDefault(BoolControl,true),
121+
zIndex: withDefault(NumberControl, Layers.modal)
121122
};
122123

123124
const ModalPropertyView = React.memo((props: {
@@ -156,6 +157,9 @@ const ModalPropertyView = React.memo((props: {
156157
{props.children.toggleClose.propertyView({
157158
label: trans("prop.toggleClose"),
158159
})}
160+
{props.children.zIndex.propertyView({
161+
label: trans("prop.zIndex"),
162+
})}
159163
</Section>
160164
<Section name={sectionNames.interaction}>{props.children.onEvent.getPropertyView()}</Section>
161165
<Section name={sectionNames.style}>{props.children.style.getPropertyView()}</Section>
@@ -278,7 +282,7 @@ const ModalView = React.memo((
278282
onCancel={handleCancel}
279283
afterClose={handleAfterClose}
280284
afterOpenChange={handleAfterOpenChange}
281-
zIndex={Layers.modal}
285+
zIndex={props.zIndex}
282286
modalRender={modalRender}
283287
mask={props.showMask}
284288
className={clsx(`app-${appID}`, props.className)}

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ export const en = {
237237
"timeZone": "TimeZone",
238238
"pickerMode": "Picker Mode",
239239
"customTags": "Allow Custom Tags",
240-
"customTagsTooltip": "Allow users to enter custom tags that are not in the options list."
240+
"customTagsTooltip": "Allow users to enter custom tags that are not in the options list.",
241+
"zIndex": "z-Index"
241242
},
242243
"autoHeightProp": {
243244
"auto": "Auto",

0 commit comments

Comments
 (0)