You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a question or bug report, please use the WebpackBin Template
to demonstrate. It is much easier for us to help you if you do.
I need a function to toggle draggable status. I do this by changing 'static' or 'isDraggable' property in layout. But changing these two properties will lead element unmounted. Mount a new element take a while in my app because it require data from network. Is there any way to change the status without re-mount the element?
The text was updated successfully, but these errors were encountered:
TL;DR: Try providing your own draggableHandle=".className":
Example:
render(){const{isDraggable}=this.props;// or state...// more codereturn<ResponsivedraggableHandle=".draggable"><divkey="x"><divclassName={isDraggable?'draggable': 'disabled'}>{/*... can be any component */}</div></div>{/*...*/}</Responsive>;}
As soon as you remove the 'draggable' className from the div, RGL will not find the handle, thus disabling dragging.
I'm impacted by this as well. When I toggle isDraggable and isResizable, all widgets are recreated.
My widgets (the draggable component) cache their queries, so remounting them does not cause network load, however they blink and/or animate which looks poorly.
Could this be fixed in the library, e.g. by calling functions, instead of adding Resizable/Draggable mixins via wrapping in new components? That should be enough to unlock react's reuse of components (I have verified the cause, but not the fix).
Thanks for submitting an issue to RGL!
Please mark the type of this issue:
If you have a question or bug report, please use the WebpackBin Template
to demonstrate. It is much easier for us to help you if you do.
I need a function to toggle draggable status. I do this by changing 'static' or 'isDraggable' property in layout. But changing these two properties will lead element unmounted. Mount a new element take a while in my app because it require data from network. Is there any way to change the status without re-mount the element?
The text was updated successfully, but these errors were encountered: