Wrong size when resizing diagonally with lockAspectRatio

Aperta
#222 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Start with the ResizableBox and Resizable behavior using lockAspectRatio, then run the linked CodeSandbox reproduction and compare diagonal resizing with version 2.0.0 versus 3.0.0 or later. The fix is done when diagonal resizing tracks the cursor without cumulative size errors, including resizing large components smaller and vice versa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Thanks for opening an issue!

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

  • Bug
  • Feature Request
  • Question
Problem Report

If lockAspectRatio option is set to true and you resize ResizableBox/Resizable diagonally, the size is wrong, the content is resized way faster than the mouse cursor moves. The issue is cumulative and is more noticeable while resizing a large ResizableBox/Resizable to a smaller one or vice versa.
It can be reproduced on version 3.0.0 and higher (see attached video resizable-3.0.4), but on version 2.0.0 and lower everything is ok (see attached video resizable-2.0.0) .

System Info

Node Version: v16.16.0
Browser: Google Chrome 113.0.5672.127
OS: Windows 10

Reproduction

https://codesandbox.io/s/long-https-uoun8f?file=/src/ResizableBox.js

https://github.com/react-grid-layout/react-resizable/assets/63339331/6868c5e7-df8e-4d2e-921a-7e6ec00ee909

https://github.com/react-grid-layout/react-resizable/assets/63339331/a57e60c1-9c27-4b6b-bc30-d210e968eb0a

Lingua principale
TypeScript
Stelle
2.6k
Fork
372
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di react-grid-layout/react-resizable

Tutte le issue di react-grid-layout/react-resizable

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.