Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Slideshow: Ensureslideshows do not stretch to parent container width on mobile if no list height is set.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ function swiperResize( swiper ) {
if ( ! img ) {
return;
}
const aspectRatio = img.naturalWidth / img.naturalHeight;
const hasNatural = img && img.naturalWidth > 0 && img.naturalHeight > 0;
const aspectRatio = hasNatural ? img.naturalWidth / img.naturalHeight : SIXTEEN_BY_NINE;
const sanityAspectRatio = Math.max( Math.min( aspectRatio, SIXTEEN_BY_NINE ), 1 );
const sanityHeight =
typeof window !== 'undefined'
Expand Down
Loading