File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,8 +296,8 @@ export class Rnd extends React.PureComponent<Props, State> {
296296 }
297297
298298 onDragStart ( e : RndDragEvent , data : DraggableData ) {
299- if ( this . props . onDragStart ) {
300- this . props . onDragStart ( e , data ) ;
299+ if ( this . props . onDragStart && this . props . onDragStart ( e , data ) === false ) {
300+ return false ;
301301 }
302302 const pos = this . getDraggablePosition ( ) ;
303303 this . originalPosition = pos ;
@@ -385,6 +385,9 @@ export class Rnd extends React.PureComponent<Props, State> {
385385 dir : ResizeDirection ,
386386 elementRef : HTMLElement ,
387387 ) {
388+ if ( this . props . onResizeStart && this . props . onResizeStart ( e , dir , elementRef ) === false ) {
389+ return false ;
390+ }
388391 e . stopPropagation ( ) ;
389392 this . setState ( {
390393 resizing : true ,
@@ -476,9 +479,6 @@ export class Rnd extends React.PureComponent<Props, State> {
476479 maxHeight : this . props . maxHeight ,
477480 } ) ;
478481 }
479- if ( this . props . onResizeStart ) {
480- this . props . onResizeStart ( e , dir , elementRef ) ;
481- }
482482 }
483483
484484 onResize (
You can’t perform that action at this time.
0 commit comments