Allow controlled resizing
See original GitHub issueCurrently 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 return auto
, and then explicitly control the size of a grand-child div from the onResize
callback.)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Make controls stretch, shrink, or move as you resize a form
To stop a control from stretching, shrinking, or moving as you resize a form, set the control's anchoring option back to the default...
Read more >Allow the User to Resize Controls at Runtime - CodeProject
Enable resizing of controls on a form at runtime with this class and two lines of code.
Read more >Resizing constraints - Sketch
The layer's behavior can be further controlled using resizing constraints applied directly to it.
Read more >resize - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
none. The element offers no user-controllable method for resizing it. ; both. The element displays a mechanism for allowing the user to resize...
Read more >Moving and Resizing Controls at Run Time - ThoughtCo
Firstly, drop several controls on a form. Have a CheckBox to enable or disable moving and resizing controls at run-time. Next, define three ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
size
property and the resize handlers).This is also a problem when using a scale transform.
For example, with a scale of 2:
An example implementation of this is how
react-draggable
exposes aDraggableCore
element which truly doesn’t manage any state, even while dragging: https://github.com/mzabriskie/react-draggableAs a workaround, you can use the “deprecated”
updateSize
method on the resizable instance to override the default sizing.