Skip to content

Commit 5c4c13f

Browse files
mat02ludomikula
authored andcommitted
Add 'Open' event on modal component
1 parent 7f2442b commit 5c4c13f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { withDefault } from "comps/generators";
2525
import SliderControl from "../controls/sliderControl";
2626

2727
const EventOptions = [
28+
{ label: trans("modalComp.open"), value: "open", description: trans("modalComp.openDesc") },
2829
{ label: trans("modalComp.close"), value: "close", description: trans("modalComp.closeDesc") },
2930
] as const;
3031

@@ -169,6 +170,9 @@ let TmpModalComp = (function () {
169170
afterClose={() => {
170171
props.toggleClose&&props.onEvent("close");
171172
}}
173+
afterOpenChange={(open: boolean) => {
174+
if (open) props.onEvent("open");
175+
}}
172176
zIndex={Layers.modal}
173177
modalRender={(node) => <ModalStyled $style={props.style}>{node}</ModalStyled>}
174178
mask={props.showMask}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,6 +2368,8 @@ export const en = {
23682368

23692369

23702370
"modalComp": {
2371+
"open": "Open",
2372+
"openDesc": "Triggered When the Modal Dialog Box is Opened",
23712373
"close": "Close",
23722374
"closeDesc": "Triggered When the Modal Dialog Box is Closed",
23732375
"openModalDesc": "Open the Dialog Box",

0 commit comments

Comments
 (0)