lockAspectRatio still breaks at independent min/max constraints
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- react, typescript
- Domínio
- frontend
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 2.6k
- Forks
- 373
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de react-grid-layout/react-resizable
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
react-grid-layout/react-resizable#237 · 8 comentários · 1 reação ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
react-grid-layout/react-resizable#222 · 4 comentários ·
Todas as issues de react-grid-layout/react-resizable
Issues semelhantes
-
Native Web
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 80/100
digitalfabrik/integreat-app#4517 ·
Mantenedores costumam responder em até 2 dias
-
TLS guide repeats certs/ in the certificate directoryTalvez já em andamento @maheshrijal assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
prometheus/docs#3156 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
medusajs/dtc-starter#90 ·
Mantenedores costumam responder em até 1 dia
-
usability
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
inmanta/web-console#7632 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
zaidmukaddam/scira#261 ·