Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On cropSize change prop doesn't trigged computeSize or updating state of state.cropSize #467

Open
Lopliok opened this issue Jun 13, 2023 · 2 comments
Labels
good first issue Good for newcomers PR-welcome help is welcomed for this issue

Comments

@Lopliok
Copy link

Lopliok commented Jun 13, 2023

Describe the bug
When property cropSize is changed in same time as zoom, computeSizes is not called. So state of cropSize is not updated.

Expected behavior
If property cropSize has changed, it will update Resizer state cropSize

image

We are using onMediaLoaded callback to calculate zoom and cropSize. Also we use range sliders to manipulate width, height, zoom.

I tried move condition in componentDidUpdate to be separately and called everytime when cropSize changed and it helps. Should I create PR for this?

image

@ValentinH
Copy link
Owner

Indeed, having all the conditions tied together doesn't seem right. Most of else should be removed I think.

By the way, why are you using cropSize instead of aspect?

@Lopliok
Copy link
Author

Lopliok commented Jul 19, 2023

I made some local patch for our case, but if i will have time i'll will try investigate how can be helpful aspect.

@ValentinH ValentinH added PR-welcome help is welcomed for this issue good first issue Good for newcomers labels Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers PR-welcome help is welcomed for this issue
Projects
None yet
Development

No branches or pull requests

2 participants