@@ -7,7 +7,7 @@ import { BoolControl } from "comps/controls/boolControl";
7
7
import { StringControl } from "comps/controls/codeControl" ;
8
8
import { booleanExposingStateControl } from "comps/controls/codeStateControl" ;
9
9
import { PositionControl , LeftRightControl , HorizontalAlignmentControl } from "comps/controls/dropdownControl" ;
10
- import { closeEvent , eventHandlerControl } from "comps/controls/eventHandlerControl" ;
10
+ import { eventHandlerControl } from "comps/controls/eventHandlerControl" ;
11
11
import { styleControl } from "comps/controls/styleControl" ;
12
12
import { DrawerStyle } from "comps/controls/styleControlConstants" ;
13
13
import { withDefault } from "comps/generators" ;
@@ -34,7 +34,10 @@ import { ToViewReturn } from "../generators/multi";
34
34
import { SimpleContainerComp } from "../comps/containerBase/simpleContainerComp" ;
35
35
import { JSX } from "react/jsx-runtime" ;
36
36
37
- const EventOptions = [ closeEvent ] as const ;
37
+ const EventOptions = [
38
+ { label : trans ( "drawer.open" ) , value : "open" , description : trans ( "drawer.openDesc" ) } ,
39
+ { label : trans ( "drawer.close" ) , value : "close" , description : trans ( "drawer.closeDesc" ) } ,
40
+ ] as const ;
38
41
39
42
const DEFAULT_SIZE = 378 ;
40
43
const DEFAULT_PADDING = 16 ;
@@ -201,12 +204,13 @@ const DrawerView = React.memo((
201
204
202
205
const onClose = useCallback ( ( e ?: React . MouseEvent | React . KeyboardEvent ) => {
203
206
props . visible . onChange ( false ) ;
204
- } , [ props . visible ] ) ;
207
+ props . onEvent ( "close" ) ;
208
+ } , [ props . visible , props . onEvent ] ) ;
205
209
206
210
const afterOpenChange = useCallback ( ( visible : boolean ) => {
207
- if ( ! visible ) {
208
- props . onEvent ( "close " ) ;
209
- }
211
+ if ( visible ) {
212
+ props . onEvent ( "open " ) ;
213
+ }
210
214
} , [ props . onEvent ] ) ;
211
215
212
216
const drawerStyles = useMemo ( ( ) => ( {
0 commit comments