re-resizable
re-resizable copied to clipboard
When dragging corner lockAspectRatio is true, use width to compute height
Overview of the problem
This is a behavioral change. Not sure if another new option should be added, or just change the behavior.
When lockAspectRatio
is true
and corner is dragged, currently, the new height is kept while width is computed based on the aspect ratio. It makes more sense to compute height based on width, because usually the width is constrained (by window width) and height is infinite when overflow the screen.
The code is here: https://github.com/bokuweb/re-resizable/blob/0f6b2ddcbab2a2864c209e0a59a67b6d51adab86/src/index.tsx#L582-L616
Execute top/bottom if first, then right/left if will change the behavior.
I can submit a PR.