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,7 +296,7 @@ export type Enable = {
296296 top ?: boolean ;
297297 topLeft ?: boolean ;
298298 topRight ?: boolean ;
299- }
299+ } | boolean
300300```
301301
302302#### ` disableDragging?: boolean; `
Original file line number Diff line number Diff line change 11import * as React from "react" ;
22import { DraggableEventHandler , default as DraggableRoot } from "react-draggable" ;
3- import { Resizable , ResizeDirection } from "re-resizable" ;
3+ import { Enable , Resizable , ResizeDirection } from "re-resizable" ;
44
55// FIXME: https://github.com/mzabriskie/react-draggable/issues/381
66// I can not find `scale` too...
@@ -80,7 +80,7 @@ export type ResizeEnable = {
8080 top ?: boolean ;
8181 topLeft ?: boolean ;
8282 topRight ?: boolean ;
83- } ;
83+ } | boolean ;
8484
8585export type HandleClasses = {
8686 bottom ?: string ;
@@ -170,6 +170,17 @@ const resizableStyle = {
170170 left : 0 ,
171171} ;
172172
173+ const getEnableResizingByFlag = ( flag : boolean ) : Enable => ( {
174+ bottom : flag ,
175+ bottomLeft : flag ,
176+ bottomRight : flag ,
177+ left : flag ,
178+ right : flag ,
179+ top : flag ,
180+ topLeft : flag ,
181+ topRight : flag ,
182+ } ) ;
183+
173184interface DefaultProps {
174185 maxWidth : number ;
175186 maxHeight : number ;
@@ -614,7 +625,7 @@ export class Rnd extends React.PureComponent<Props, State> {
614625 ref = { this . refResizable }
615626 defaultSize = { defaultValue }
616627 size = { this . props . size }
617- enable = { enableResizing }
628+ enable = { typeof enableResizing === "boolean" ? getEnableResizingByFlag ( enableResizing ) : enableResizing }
618629 onResizeStart = { this . onResizeStart }
619630 onResize = { this . onResize }
620631 onResizeStop = { this . onResizeStop }
You can’t perform that action at this time.
0 commit comments