Responsiveness breaks when using my array of images, it's fine when using example array.
Hi,
When using the example array below, the responsiveness of the component is great.
[
{
"original": "https://picsum.photos/id/1018/1000/600/",
"thumbnail": "https://picsum.photos/id/1018/250/150/"
},
{
"original": "https://picsum.photos/id/1015/1000/600/",
"thumbnail": "https://picsum.photos/id/1015/250/150/"
},
{
"original": "https://picsum.photos/id/1019/1000/600/",
"thumbnail": "https://picsum.photos/id/1019/250/150/"
}
]
When using my own array below, the responsiveness breaks. Is there any obvious reason I'm missing that would cause this, I'm not sure where to start to resolve this. Any guidance or hints would be really appreciated.
[
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/f94e5432ae86ff5d2b2b558954210d504b72a1e3-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/f94e5432ae86ff5d2b2b558954210d504b72a1e3-1350x1350.jpg?w=300&h=300&fit=crop"
},
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/354cb0d6659ec66daff8c9302134197a1651b369-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/354cb0d6659ec66daff8c9302134197a1651b369-1350x1350.jpg?w=300&h=300&fit=crop"
},
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/7d2dc816c1606f56fd9a544a686f00a8c8af92e1-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/7d2dc816c1606f56fd9a544a686f00a8c8af92e1-1350x1350.jpg?w=300&h=300&fit=crop"
},
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/b3f18b6f66bfaaf1269af71fbb9a2356f0edeb57-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/b3f18b6f66bfaaf1269af71fbb9a2356f0edeb57-1350x1350.jpg?w=300&h=300&fit=crop"
},
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/bf10c5b3f1439cb7a51ca8c464a258beb6e61ce7-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/bf10c5b3f1439cb7a51ca8c464a258beb6e61ce7-1350x1350.jpg?w=300&h=300&fit=crop"
},
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/b4bca085b6fccebdfbe9d5275775fcc26b83088c-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/b4bca085b6fccebdfbe9d5275775fcc26b83088c-1350x1350.jpg?w=300&h=300&fit=crop"
},
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/2efea22d6ff8c69fbb27dafa587b6b2eb0a691f1-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/2efea22d6ff8c69fbb27dafa587b6b2eb0a691f1-1350x1350.jpg?w=300&h=300&fit=crop"
},
{
"original": "https://cdn.sanity.io/images/p410jtyo/production/95ab1699b1600820b100473e902526348f906d21-1350x1350.jpg?w=600&h=600&fit=crop",
"thumbnail": "https://cdn.sanity.io/images/p410jtyo/production/95ab1699b1600820b100473e902526348f906d21-1350x1350.jpg?w=300&h=300&fit=crop"
}
]
Have added some images to give more of an example.

The only change I make the object array the component uses.
Ok so after some further testing I found the issue.
It seems the gallery can have a maximum of 3 images before it breaks the responsiveness. Not sure if anyone else has experienced this, but maybe useful.
The example is using more than 3 images. Possible there is some conflicting CSS on your end that may be causing this?
Check out the demo and sample code. http://linxtion.com/demo/react-image-gallery https://github.com/xiaolin/react-image-gallery/blob/master/example/app.js
You're right, really odd! At the moment I'm just using three images (I've been moving house and need to get this site done asap) Once I have it live I'll do some more testing, and let you know. Thanks for having a look.
I have the exact same problem, came here and see that its already been reported. Reproduced also with @Geerodge's images.

One way to solve this is to set showThumbnails={false} which fixes the issue.
But the real issue seems to be that when this component is dropped into a flex box (like Material UI grid), it cannot handle. Eg in dev tools temporarily turning off display:flex on the parent container, makes things OK.
.MuiGrid-container {
width: 100%;
/* display: flex; */
flex-wrap: wrap;
box-sizing: border-box;

Perhaps @Geerodge , like me you are dropping this component into a grid?
I had similar issue in the mobile view. I tried to pinpoint the exact issue which was causing this and found out that white-space: nowrap was causing the issue ( followed @zehawki's hint, it was in the thumbnails container ). It turns out this is not a problem specific with this library, there is some issue using nowrap with flex box ( see this issue on stackoverflow ). Setting min-width: 0 on the immediate parent container for the thumbnails layout resolved the issue for me.