Skip to content

Commit aae022f

Browse files
committed
fix: also remove lazy loading on carousel images
1 parent fe6d23c commit aae022f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/block/carousel/frontend-carousel.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ class _StackableCarousel {
4444
this.liveregion.setAttribute( 'class', 'liveregion stk--hidden' )
4545
this.wrapper.appendChild( this.liveregion )
4646

47+
// Get all images and set loading to eager to make the browser
48+
// calculate the grid height correctly
49+
const images = this.el.querySelectorAll( 'img' )
50+
images.forEach( image => {
51+
image.loading = 'eager'
52+
} )
53+
4754
this.fixChildrenAccessibility() // This needs to be first before infinte scrolling clones slides.
4855
this.initProperties()
4956
}

0 commit comments

Comments
 (0)