File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,14 @@ export const resizableProps: Object = {
8888 /*
8989 * Initial height
9090 * */
91- height : PropTypes . number . isRequired ,
91+ height : ( ...args ) => {
92+ const [ props ] = args ;
93+ // Required if resizing height or both
94+ if ( props . axis === 'both' || props . axis === 'y' ) {
95+ return PropTypes . number . isRequired ( ...args ) ;
96+ }
97+ return PropTypes . number ( ...args ) ;
98+ } ,
9299 /*
93100 * Customize cursor resize handle
94101 * */
@@ -141,5 +148,12 @@ export const resizableProps: Object = {
141148 /*
142149 * Initial width
143150 */
144- width : PropTypes . number . isRequired ,
151+ width : ( ...args ) => {
152+ const [ props ] = args ;
153+ // Required if resizing width or both
154+ if ( props . axis === 'both' || props . axis === 'x' ) {
155+ return PropTypes . number . isRequired ( ...args ) ;
156+ }
157+ return PropTypes . number ( ...args ) ;
158+ } ,
145159} ;
You can’t perform that action at this time.
0 commit comments