Skip to content

Commit eaced9f

Browse files
author
ricwilson
committed
fix: adjust image display logic in ImageCropControl for better visibility handling
1 parent 95b8a67 commit eaced9f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ImageCrop/ImageCrop/components/imageCropControl.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,17 @@ const ImageCropControl: React.FC<IImageCropControlProps> = (props) => {
8484
maxHeight={maxHeight}
8585
aspect={aspect}
8686
keepSelection={keepSelection}
87+
style={{display: imageSrc && pcfContext.isVisible() ? 'block' : 'none',}}
8788
>
8889
<img
8990
ref={imgRef}
9091
alt="Crop"
9192
src={imageSrc || ''}
9293
style={{
9394
maxWidth: '100%',
94-
maxHeight: '100%',
95-
display: imageSrc && pcfContext.isVisible() ? 'block' : 'none',
95+
maxHeight: '100%',
9696
transform: `rotate(${rotation}deg) scale(${scaling})`
97-
}}
98-
onError={(e) => {
99-
(e.target as HTMLImageElement).style.display = 'none';
100-
}}
97+
}}
10198
/>
10299
</CropWrapper>
103100
);

0 commit comments

Comments
 (0)