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
{{ message }}
Repository navigation
size constraints take precedence over aspect ratio #51
Please select the type of issue you're reporting. For questions.
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
Activity
jscottsmith commentedon Apr 17, 2018
Just came across this behavior -- any plans to address this issue? Accepting PRs?
jakeBlank commentedon May 11, 2020
+1
nerevarishe101 commentedon May 25, 2022
+1
STRML commentedon May 25, 2022
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 commentedon Dec 31, 2025
Closing due to staleness (8+ years). Constraint and aspect ratio logic has been rewritten since then.