File tree 1 file changed +16
-2
lines changed
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 = {
88
88
/*
89
89
* Initial height
90
90
* */
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
+ } ,
92
99
/*
93
100
* Customize cursor resize handle
94
101
* */
@@ -141,5 +148,12 @@ export const resizableProps: Object = {
141
148
/*
142
149
* Initial width
143
150
*/
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
+ } ,
145
159
} ;
You can’t perform that action at this time.
0 commit comments