@@ -101,28 +101,26 @@ export class Group<T extends TGroup = TGroup> extends GraphComponent<TGroupProps
101101 this . subscribeToGroup ( ) ;
102102
103103 this . addEventListener ( "click" , ( event : MouseEvent ) => {
104- event . stopPropagation ( ) ;
105104 this . groupState . setSelection (
106105 true ,
107106 ! isMetaKeyEvent ( event ) ? ESelectionStrategy . REPLACE : ESelectionStrategy . APPEND
108107 ) ;
109108 } ) ;
110109
111110 this . onDrag ( {
111+ isDraggable : ( ) => this . isDraggable ( ) ,
112112 onDragUpdate : ( { diffX, diffY } ) => {
113- if ( this . isDraggable ( ) ) {
114- const rect = {
115- x : this . state . rect . x - diffX ,
116- y : this . state . rect . y - diffY ,
117- width : this . state . rect . width ,
118- height : this . state . rect . height ,
119- } ;
120- this . setState ( {
121- rect,
122- } ) ;
123- this . updateHitBox ( rect ) ;
124- this . props . onDragUpdate ( this . props . id , { diffX, diffY } ) ;
125- }
113+ const rect = {
114+ x : this . state . rect . x - diffX ,
115+ y : this . state . rect . y - diffY ,
116+ width : this . state . rect . width ,
117+ height : this . state . rect . height ,
118+ } ;
119+ this . setState ( {
120+ rect,
121+ } ) ;
122+ this . updateHitBox ( rect ) ;
123+ this . props . onDragUpdate ( this . props . id , { diffX, diffY } ) ;
126124 } ,
127125 } ) ;
128126 }
0 commit comments