react-image-gallery icon indicating copy to clipboard operation
react-image-gallery copied to clipboard

Whole slider size goes wild when different image sizes comes into play

Open ModithaAk opened this issue 1 year ago • 1 comments

Describe the bug when there are smaller pictures the whole slider goes wild with shrinking and growing

Image Gallery Version latest

To Reproduce Steps to reproduce the behavior:

  1. try different image sizes instead of the same image size

Expected behavior some way to keep the size of the slider consistent

Screenshots image image

ModithaAk avatar Jul 20 '22 22:07 ModithaAk

I'm not sure I understand the issue here. Can you clip a video?

xiaolin avatar Jul 28 '22 17:07 xiaolin

I think @ModithaAk is saying that the <ImageGallery> resizes when image size varies, and they don't want this to happen.

cajakil avatar Sep 25 '22 18:09 cajakil

Ah, the gallery does not take into account different image sizes and generally, you should have consistent image height & width for a better user experience. If you'd like to have various sizes Id leave it up to you to modify the CSS to support your use case.

xiaolin avatar Oct 01 '22 21:10 xiaolin

For the future visitors of this thread (like me), I solved it with some CSS:

Creating a container with the image class:

const ImageContainer = styled.div`
    .image-gallery-image {
        width: 100%;
        height: 600px;
    }
`;

Then wrapping the ImageGallery:

                <ImageContainer>
                    <ImageGallery
                        items={images}
                        thumbnailPosition="bottom"
                        infinite={true}
                        showBullets={true}
                        showNav={true}
                        showIndex={true}
                        additionalClass="simple-border"
                        />
                </ImageContainer>

jmaister avatar Feb 20 '23 21:02 jmaister