@@ -171,6 +171,7 @@ const SCHEDULER_CELL_DXCLICK_EVENT_NAME = addNamespace(clickEventName, 'dxSchedu
171171
172172const SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME = addNamespace ( pointerEvents . down , 'dxSchedulerDateTable' ) ;
173173const SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME = addNamespace ( pointerEvents . up , 'dxSchedulerDateTable' ) ;
174+ const SCHEDULER_TABLE_DXPOINTERUP_EVENT_NAME = addNamespace ( pointerEvents . up , 'dxSchedulerTable' ) ;
174175
175176const SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME = addNamespace ( pointerEvents . move , 'dxSchedulerDateTable' ) ;
176177
@@ -221,6 +222,10 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
221222
222223 private selectionChangedAction : any ;
223224
225+ private selectionEndAction : any ;
226+
227+ private isSelectionStartedOnCell = false ;
228+
224229 private isCellClick : any ;
225230
226231 private contextMenuHandled : any ;
@@ -986,6 +991,7 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
986991
987992 protected attachEvents ( ) {
988993 this . createSelectionChangedAction ( ) ;
994+ this . createSelectionEndAction ( ) ;
989995 this . attachClickEvent ( ) ;
990996 this . attachContextMenuEvent ( ) ;
991997 }
@@ -1014,6 +1020,14 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
10141020 const $cell = $ ( e . target ) ;
10151021 that . cellClickAction ( { event : e , cellElement : getPublicElement ( $cell ) , cellData : that . getCellData ( $cell ) } ) ;
10161022 } ) ;
1023+
1024+ ( eventsEngine . off as any ) ( domAdapter . getDocument ( ) , SCHEDULER_TABLE_DXPOINTERUP_EVENT_NAME ) ;
1025+ eventsEngine . on ( domAdapter . getDocument ( ) , SCHEDULER_TABLE_DXPOINTERUP_EVENT_NAME , ( ) => {
1026+ if ( this . isSelectionStartedOnCell ) {
1027+ this . fireSelectionEndEvent ( ) ;
1028+ this . isSelectionStartedOnCell = false ;
1029+ }
1030+ } ) ;
10171031 }
10181032
10191033 private createCellClickAction ( ) {
@@ -1026,10 +1040,15 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
10261040 this . selectionChangedAction = this . _createActionByOption ( 'onSelectionChanged' ) ;
10271041 }
10281042
1043+ private createSelectionEndAction ( ) {
1044+ this . selectionEndAction = this . _createActionByOption ( 'onSelectionEnd' ) ;
1045+ }
1046+
10291047 // eslint-disable-next-line @typescript-eslint/no-unused-vars
10301048 private cellClickHandler ( argument ?: any ) {
10311049 if ( this . showPopup ) {
10321050 delete this . showPopup ;
1051+ this . isSelectionStartedOnCell = false ;
10331052 this . handleSelectedCellsClick ( ) ;
10341053 }
10351054 }
@@ -1039,10 +1058,12 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
10391058
10401059 if ( ! $target . hasClass ( DATE_TABLE_CELL_CLASS ) && ! $target . hasClass ( ALL_DAY_TABLE_CELL_CLASS ) ) {
10411060 this . isCellClick = false ;
1061+ this . isSelectionStartedOnCell = false ;
10421062 return ;
10431063 }
10441064
10451065 this . isCellClick = true ;
1066+ this . isSelectionStartedOnCell = true ;
10461067 if ( $target . hasClass ( DATE_TABLE_FOCUSED_CELL_CLASS ) ) {
10471068 this . showPopup = true ;
10481069 } else {
@@ -1932,6 +1953,13 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
19321953 this . selectionChangedAction ( { selectedCellData } ) ;
19331954 }
19341955
1956+ private fireSelectionEndEvent ( ) {
1957+ const selectedCellData = this . option ( 'selectedCellData' ) ?? [ ] ;
1958+ if ( selectedCellData . length > 0 && this . selectionEndAction ) {
1959+ this . selectionEndAction ( { selectedCellData } ) ;
1960+ }
1961+ }
1962+
19351963 private getCellByData ( cellData ) {
19361964 const {
19371965 startDate, groupIndex, allDay, index,
@@ -2370,6 +2398,9 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
23702398 case 'onSelectionChanged' :
23712399 this . createSelectionChangedAction ( ) ;
23722400 break ;
2401+ case 'onSelectionEnd' :
2402+ this . createSelectionEndAction ( ) ;
2403+ break ;
23732404 case 'onCellClick' :
23742405 this . createCellClickAction ( ) ;
23752406 break ;
0 commit comments