-
-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow controlled resizing #319
Comments
One usecase where you can use it is when you have absolute position of box and you are resizing (left, top). You might want change (left, top) position. |
This is also a problem when using a scale transform. For example, with a scale of 2: An example implementation of this is how As a workaround, you can use the "deprecated" |
Yep I face same issue using |
Another use case is when implementing auto scroll functionality to sync resizing with scroll speed. |
Hi @yang , Would you mind giving an example. Also how would I go about resizing the left edge? Thanks, |
@yang @jakub-chatrny @chathuraa @mdanka #391 resizeRatio is added. Could you please try it? |
It wasn't immediately clear to me from reading this ticket, so I just wanted to clarify that this functionality does appear to be currently implemented in the latest version (using the |
Agree with @JoshuaCWebDeveloper; this can be accomplished by using the size property, setting it with your own state (i.e. width, height), and then on the onResize event changing dimensions as desired by updating the state. Should probably close this issue. |
It isn't really contolled, the problem is that it maintains internal state and does the sizing based on that. It does accept and synchronize outside state via props, but while resizing it's ignored and the internal state is used, meaning that I'm not really controlling the size, for instance I can't stop resizing at some point (e.g. reached some boundary), because the internal state keeps going. |
Currently re-resizable exclusively owns the width/height during a resize. It would be powerful to make this controllable, so that users can implement (for instance) their own sizing (snapping, clamping, etc.) logic.
(As a hack for now, one can override the
calculateNewSize
method to always returnauto
, and then explicitly control the size of a grand-child div from theonResize
callback.)The text was updated successfully, but these errors were encountered: