Skip to content

Commit 0a18b11

Browse files
authored
Merge pull request #1055 from MenamAfzal/feat/toggle-modal-close
toggle modal close
2 parents 3e84c3b + b19d7fb commit 0a18b11

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ let TmpModalComp = (function () {
105105
style: styleControl(ModalStyle),
106106
maskClosable: withDefault(BoolControl, true),
107107
showMask: withDefault(BoolControl, true),
108+
toggleClose:withDefault(BoolControl,true)
108109
},
109110
(props, dispatch) => {
110111
const userViewMode = useUserViewMode();
@@ -147,6 +148,7 @@ let TmpModalComp = (function () {
147148
<BackgroundColorContext.Provider value={props.style.background}>
148149
<ModalWrapper>
149150
<StyledModal
151+
closable={props.toggleClose}
150152
height={height}
151153
resizeHandles={resizeHandles}
152154
onResizeStop={onResizeStop}
@@ -160,10 +162,10 @@ let TmpModalComp = (function () {
160162
$titleAlign={props.titleAlign}
161163
width={width}
162164
onCancel={(e) => {
163-
props.visible.onChange(false);
165+
props.toggleClose&&props.visible.onChange(false);
164166
}}
165167
afterClose={() => {
166-
props.onEvent("close");
168+
props.toggleClose&&props.onEvent("close");
167169
}}
168170
zIndex={Layers.modal}
169171
modalRender={(node) => <ModalStyled $style={props.style}>{node}</ModalStyled>}
@@ -208,6 +210,9 @@ let TmpModalComp = (function () {
208210
{children.showMask.propertyView({
209211
label: trans("prop.showMask"),
210212
})}
213+
{children.toggleClose.propertyView({
214+
label: trans("prop.toggleClose"),
215+
})}
211216
</Section>
212217
<Section name={sectionNames.interaction}>{children.onEvent.getPropertyView()}</Section>
213218
<Section name={sectionNames.style}>{children.style.getPropertyView()}</Section>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export const en = {
195195
"innerSider" : "Inner Sider",
196196
"showFooter": "Show Footer",
197197
"maskClosable": "Click Outside to Close",
198+
"toggleClose": "Enable Close Button",
198199
"showMask": "Show Mask",
199200
"textOverflow": "Text Overflow",
200201
"scrollbar" : "Show Scrollbars",

0 commit comments

Comments
 (0)