lockAspectRatio still breaks at independent min/max constraints
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
Start at the lockAspectRatio constraint projection and clamping logic in the current implementation, then run the focused regression test described in the issue. Verify width and height minimum and maximum bounds, overshoot/return, and a subsequent gesture preserve the aspect ratio when possible. Confirm the incompatible-bounds control still gives size constraints precedence.
由索引模型根据 Issue 内容生成。
描述
With lockAspectRatio enabled, independently calculated width and height constraints can still change the aspect ratio on current master (c6fd4ab8d3d4e9c0707c2bbb6d47d0fcbdb5e6b9, 4.0.2).
For example, start at 300 × 150 (2:1), set minConstraints={[100, 50]} and maxConstraints={[420, 400]}, then drag the southeast handle toward 600 × 300. The current result is 420 × 300 rather than 420 × 210. The width and height are clamped independently after projection onto the ratio line. With a controlled component, that changed ratio also becomes the next resize's input ratio.
Expected: when a size satisfying both bounds and the ratio exists, keep the ratio and choose that size. If the bounds make the ratio impossible, retain size-constraint precedence rather than exceeding a bound.
Related historical report: #51. The current implementation still reproduces this despite the later projection rewrite. I have a focused regression test covering width/height minimum and maximum bounds, overshoot/return and a subsequent gesture. Five new tests fail on unchanged master; the incompatible-bounds control passes.
- 主要语言
- TypeScript
- 星标
- 2.6k
- 派生
- 373
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react-grid-layout/react-resizable 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 38/100
react-grid-layout/react-resizable#237 · 8 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 55/100
react-grid-layout/react-resizable#222 · 4 条评论 ·
查看 react-grid-layout/react-resizable 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
cline/mcp-marketplace#2932 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 82/100
lingdojo/kana-dojo#32188 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 76/100
Portkey-AI/gateway#1844 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 61/100
rjsf-team/react-jsonschema-form#5495 ·
维护者通常 2 天内回复