@@ -7,7 +7,7 @@ import { BoolControl } from "comps/controls/boolControl";
77import { StringControl } from "comps/controls/codeControl" ;
88import { booleanExposingStateControl } from "comps/controls/codeStateControl" ;
99import { PositionControl , LeftRightControl , HorizontalAlignmentControl } from "comps/controls/dropdownControl" ;
10- import { closeEvent , eventHandlerControl } from "comps/controls/eventHandlerControl" ;
10+ import { eventHandlerControl } from "comps/controls/eventHandlerControl" ;
1111import { styleControl } from "comps/controls/styleControl" ;
1212import { DrawerStyle } from "comps/controls/styleControlConstants" ;
1313import { withDefault } from "comps/generators" ;
@@ -34,7 +34,10 @@ import { ToViewReturn } from "../generators/multi";
3434import { SimpleContainerComp } from "../comps/containerBase/simpleContainerComp" ;
3535import { JSX } from "react/jsx-runtime" ;
3636
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 ;
3841
3942const DEFAULT_SIZE = 378 ;
4043const DEFAULT_PADDING = 16 ;
@@ -201,12 +204,13 @@ const DrawerView = React.memo((
201204
202205 const onClose = useCallback ( ( e ?: React . MouseEvent | React . KeyboardEvent ) => {
203206 props . visible . onChange ( false ) ;
204- } , [ props . visible ] ) ;
207+ props . onEvent ( "close" ) ;
208+ } , [ props . visible , props . onEvent ] ) ;
205209
206210 const afterOpenChange = useCallback ( ( visible : boolean ) => {
207- if ( ! visible ) {
208- props . onEvent ( "close " ) ;
209- }
211+ if ( visible ) {
212+ props . onEvent ( "open " ) ;
213+ }
210214 } , [ props . onEvent ] ) ;
211215
212216 const drawerStyles = useMemo ( ( ) => ( {
0 commit comments