@@ -33,6 +33,7 @@ export const RightResizable : React.FC<IPublicProps & IAnchoredProps & IResizabl
3333RightResizable . propTypes = { ...publicProps , ...anchoredProps , ...resizableProps } ;
3434export const Positioned : React . FC < IPublicProps & IResizableProps & IPositionedProps > = ( props ) => < SpaceInternal { ...props } />
3535RightResizable . propTypes = { ...publicProps , ...resizableProps , ...positionedProps } ;
36+ export const Custom : React . FC < AllProps > = ( props ) => < SpaceInternal { ...props } />
3637
3738export const SpaceInternal : React . FC < AllProps > = React . memo ( ( props ) => {
3839
@@ -95,6 +96,13 @@ export const SpaceInternal : React.FC<AllProps> = React.memo((props) => {
9596 if ( ! divElementRef . current ) {
9697 return ;
9798 }
99+
100+ if ( props . onResizeStart ) {
101+ const result = props . onResizeStart ( ) ;
102+ if ( typeof result === "boolean" && ! result ) {
103+ return ;
104+ }
105+ }
98106
99107 var rect = divElementRef . current . getBoundingClientRect ( ) ;
100108 var size = isHorizontalSpace ( props . anchor ) ? rect . width : rect . height ;
@@ -129,13 +137,19 @@ export const SpaceInternal : React.FC<AllProps> = React.memo((props) => {
129137 window . addEventListener ( 'touchend' , removeListener ) ;
130138 e . preventDefault ( ) ;
131139 e . stopPropagation ( ) ;
132- props . onResizeStart && props . onResizeStart ( ) ;
133140 } ;
134141
135142 const startResize = ( e : React . MouseEvent < HTMLDivElement , MouseEvent > ) => {
136143 if ( ! divElementRef . current ) {
137144 return ;
138145 }
146+
147+ if ( props . onResizeStart ) {
148+ const result = props . onResizeStart ( ) ;
149+ if ( typeof result === "boolean" && ! result ) {
150+ return ;
151+ }
152+ }
139153
140154 var rect = divElementRef . current . getBoundingClientRect ( ) ;
141155 var size = isHorizontalSpace ( props . anchor ) ? rect . width : rect . height ;
@@ -170,7 +184,6 @@ export const SpaceInternal : React.FC<AllProps> = React.memo((props) => {
170184 window . addEventListener ( 'mouseup' , removeListener ) ;
171185 e . preventDefault ( ) ;
172186 e . stopPropagation ( ) ;
173- props . onResizeStart && props . onResizeStart ( ) ;
174187 } ;
175188
176189 resizeHandle =
0 commit comments