react-mops icon indicating copy to clipboard operation
react-mops copied to clipboard

Support Orientation/Position/Size props change

Open ustccjw opened this issue 6 years ago • 4 comments

make react-mops to be a control component

ustccjw avatar Oct 23 '19 07:10 ustccjw

Yeah, it would be great to have it, because there is no callbacks at the moment, such as: onDragStart, onDragStop, onResizeStart, onResizeStop.

pawelkosmicki avatar Oct 24 '19 20:10 pawelkosmicki

@ustccjw can you better explain what you expect? (codesample)

@pawelkosmicki There are callbacks for all of them here's an example: https://github.com/dekk-app/react-mops/blob/master/packages/demo/src/pages/home.tsx#L235-L243 where I use it in combination with redux.

onResizeStart, onResize, onResizeEnd
onDragStart, onDrag, onDragEnd
onRotateStart, onRotate, onRotateEnd

I am currently working on v2. It will include a documentation with better examples.

pixelass avatar Oct 25 '19 08:10 pixelass

@pixelass when Orientation/Position/Size has been changed by props,component will change the Orientation/Position/Size state - this is my need.

ustccjw avatar Oct 28 '19 02:10 ustccjw

Right now those props only serve as initialStates. In v2 you can build your own custom box to add this feature.

v2 will most probably deliver several dedicated components with different behavior, so once implemented this could be added by a PR as new export.

I see how this can be helpful and it will definitely be added since I myself need this feature eventually.

pixelass avatar Oct 28 '19 14:10 pixelass