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

The previous image layout still be kept after switch image #585

Open
daFoggo opened this issue Mar 30, 2024 · 1 comment
Open

The previous image layout still be kept after switch image #585

daFoggo opened this issue Mar 30, 2024 · 1 comment

Comments

@daFoggo
Copy link

daFoggo commented Mar 30, 2024

Hi. I'm currently having this issues. Can someone help me please?
https://github.com/sekoyo/react-image-crop/assets/108665939/7fa65ecb-112a-435a-939f-74d7bfb60707

@bodryi
Copy link

bodryi commented Jul 2, 2024

@daFoggo Hello!
As a workaround, you can add unique key to ReactCrop component, so it will rerender every time your image updates.

<ReactCrop
  key={uniqueImageKey}
  circularCrop
  keepSelection
  crop={crop}
  aspect={1}
  minWidth={50}
  onChange={(_, percentCrop) => setCrop(percentCrop)}
  onComplete={(c) => setCompletedCrop(c)}
>
   {/* Your image */}
</ReactCrop>

Possibly the problem is with rect in svg def. It has width and height 100% and it doesn't update visually when image dimensions are changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants