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

size constraints take precedence over aspect ratio

Open TanninOne opened this issue 8 years ago • 4 comments

Thanks for opening an issue!

Please select the type of issue you're reporting. For questions.

  • [x] Bug
  • [ ] Feature Request
  • [ ] Question

Problem Report

When you specify both min/max constraints and lockAspectRatio and the constraints are not in the aspect ratio then you can resize the pane to the wrong aspect. That's to say: you can always resize in the full constraint range even if this violates the aspect ratio constraint. I think intuitively the aspect ratio should always be obeyed even this limits the resizeable range.

In my use case the initial width/height is computed based on the data being displayed (an image) whereas the min/max are computed based on the available space so the min/max will not be in the same ratio. Of course I could manually recalculate min/max such that it has the same ratio but it would be cleaner if react-resizable did that for me.

System Info

Node Version: 6.5 Browser: electron 1.4.3 OS: Windows

TanninOne avatar Feb 13 '17 16:02 TanninOne

Just came across this behavior -- any plans to address this issue? Accepting PRs?

jscottsmith avatar Apr 17 '18 19:04 jscottsmith

+1

jakeBlank avatar May 11 '20 18:05 jakeBlank

+1

nerevarishe101 avatar May 25 '22 14:05 nerevarishe101

Ok - so set your constraints to match the ratio, or, if this is a huge issue for you that you can compellingly advocate for, open a PR please.

STRML avatar May 25 '22 14:05 STRML