@@ -4,6 +4,7 @@ import type { dxElementWrapper } from '@js/core/renderer';
44import $ from '@js/core/renderer' ;
55import dateUtils from '@js/core/utils/date' ;
66import { Deferred , when } from '@js/core/utils/deferred' ;
7+ import { extend } from '@js/core/utils/extend' ;
78import { getWidth } from '@js/core/utils/size' ;
89import { getWindow } from '@js/core/utils/window' ;
910import type { ToolbarItem } from '@js/ui/popup' ;
@@ -94,7 +95,7 @@ export class AppointmentPopup {
9495
9596 _createPopupConfig ( ) {
9697 const editingConfig = this . scheduler . getEditingConfig ( ) ;
97- const userPopupOptions = editingConfig ?. popup ?? { } ;
98+ const customPopupOptions = editingConfig ?. popup ?? { } ;
9899
99100 const defaultPopupConfig = {
100101 height : 'auto' ,
@@ -104,8 +105,9 @@ export class AppointmentPopup {
104105 preventScrollEvents : false ,
105106 enableBodyScroll : false ,
106107 _ignorePreventScrollEventsDeprecation : true ,
107- onHiding : ( ) : void => {
108+ onHiding : ( e ) : void => {
108109 this . scheduler . focus ( ) ;
110+ customPopupOptions ?. onHiding ?.( e ) ;
109111 } ,
110112 contentTemplate : ( ) : dxElementWrapper => {
111113 this . form . create ( {
@@ -115,14 +117,17 @@ export class AppointmentPopup {
115117
116118 return this . form . dxForm . $element ( ) ;
117119 } ,
118- onShowing : ( e ) : void => this . _onShowing ( e ) ,
120+ onShowing : ( e ) : void => {
121+ this . _onShowing ( e ) ;
122+ customPopupOptions ?. onShowing ?.( e ) ;
123+ } ,
119124 wrapperAttr : { class : APPOINTMENT_POPUP_CLASS } ,
120125 } ;
121126
122- return {
123- ... defaultPopupConfig ,
124- ... userPopupOptions ,
125- } ;
127+ return extend ( true , { } , defaultPopupConfig , customPopupOptions , {
128+ onHiding : defaultPopupConfig . onHiding ,
129+ onShowing : defaultPopupConfig . onShowing ,
130+ } ) ;
126131 }
127132
128133 _onShowing ( e ) {
0 commit comments